Support for Datadog tracing in CartService and RedisDB.

Updated the README documentation
This commit is contained in:
Rahul Jagad 2020-09-01 19:50:21 -07:00
parent 8c6da2c0d5
commit 550c2b86b2
6 changed files with 67 additions and 2 deletions

View file

@ -22,6 +22,38 @@ If youre using this demo, please **★Star** this repository to show your int
Looking for the old Hipster Shop frontend interface? Use the [manifests](https://github.com/GoogleCloudPlatform/microservices-demo/tree/v0.1.5/kubernetes-manifests) in release [v0.1.5](https://github.com/GoogleCloudPlatform/microservices-demo/releases/v0.1.5). Looking for the old Hipster Shop frontend interface? Use the [manifests](https://github.com/GoogleCloudPlatform/microservices-demo/tree/v0.1.5/kubernetes-manifests) in release [v0.1.5](https://github.com/GoogleCloudPlatform/microservices-demo/releases/v0.1.5).
## Quick Start (For Relyance developer)
Run the following commands, if you want to get the online boutique app quickly up and running
1. Enable kubernetes using "Docker For Desktop" (Docker -> Preference -> Kuberentes -> Enable Kuberentes -> Apply & Restart).
2. Login to your google cloud account (if not already done )
```
gcloud auth login
gcloud auth configure-docker
```
3. Create the secret for docker registry (which is used to pull the images from relyance-internal project)
```
kubectl --namespace=default create secret docker-registry gcr --docker-server=https://gcr.io --docker-username=oauth2accesstoken --docker-password="$(gcloud auth print-access-token)" --docker-email=engineer@relyance.ai
```
4. Patch the service account with newly created secret
```
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "gcr"}]}'
```
5. Configure Datadog agent permissions ( skip if you dont care about APM tools)
```
kubectl apply -f "https://raw.githubusercontent.com/DataDog/datadog-agent/master/Dockerfiles/manifests/rbac/clusterrole.yaml"
kubectl apply -f "https://raw.githubusercontent.com/DataDog/datadog-agent/master/Dockerfiles/manifests/rbac/serviceaccount.yaml"
kubectl apply -f "https://raw.githubusercontent.com/DataDog/datadog-agent/master/Dockerfiles/manifests/rbac/clusterrolebinding.yaml"
```
6. Run the Online Boutique App
```
kubectl apply -f release/kubernetes-manifests.yaml
```
## Screenshots ## Screenshots
| Home Page | Checkout Screen | | Home Page | Checkout Screen |

View file

@ -36,8 +36,32 @@ spec:
value: "redis-cart:6379" value: "redis-cart:6379"
- name: PORT - name: PORT
value: "7070" value: "7070"
- name: DD_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: DD_ENV
value: "prod"
- name: DD_LOGS_INJECTION
value: "true"
- name: DD_TRACE_ENABLED
value: "true"
- name: DD_SERVICE
value: "cartservice"
- name: DD_VERSION
value: "latest"
- name: LISTEN_ADDR - name: LISTEN_ADDR
value: "0.0.0.0" value: "0.0.0.0"
- name: CORECLR_ENABLE_PROFILING
value: "1"
- name: CORECLR_PROFILER
value: "{846F5F1C-F9AE-4B07-969E-05C26BC060D8}"
- name: CORECLR_PROFILER_PATH
value: /opt/datadog/Datadog.Trace.ClrProfiler.Native.so
- name: DD_INTEGRATIONS
value: /opt/datadog/integrations.json
- name: DD_DOTNET_TRACER_HOME
value: /opt/datadog
resources: resources:
requests: requests:
cpu: 200m cpu: 200m

View file

@ -39,6 +39,10 @@ spec:
value: prod value: prod
- name: DD_SERVICE - name: DD_SERVICE
value: redis-cart value: redis-cart
- name: DD_VERSION
value: latest
- name: DD_LOGS_INJECTION
value: "true"
ports: ports:
- containerPort: 6379 - containerPort: 6379
readinessProbe: readinessProbe:

View file

@ -37,6 +37,11 @@ RUN apk add --no-cache \
libstdc++ \ libstdc++ \
libintl \ libintl \
icu icu
RUN apk --no-cache add curl
RUN mkdir -p /opt/datadog
RUN curl -L https://github.com/DataDog/dd-trace-dotnet/releases/download/v1.19.2/datadog-dotnet-apm-1.19.2-musl.tar.gz | tar xzf - -C /opt/datadog
RUN sh /opt/datadog/createLogPath.sh
WORKDIR /app WORKDIR /app
COPY --from=builder /cartservice . COPY --from=builder /cartservice .
ENTRYPOINT ["./cartservice", "start"] ENTRYPOINT ["./cartservice", "start"]

View file

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
using System; using System;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;

View file

@ -78,4 +78,4 @@ class UserBehavior(TaskSet):
class WebsiteUser(HttpLocust): class WebsiteUser(HttpLocust):
task_set = UserBehavior task_set = UserBehavior
wait_time = between(1, 10) wait_time = between(10, 30)