-
Notifications
You must be signed in to change notification settings - Fork 148
Add OpenTelemetry trace functionality to cartservice #744
Conversation
* Gateway collector collects from agents and forwards to cloud project * Agent collector in cartservice will forward trace information to gateway
* Add OpenTelemetry agent to docker-compose.yaml
The initContainer retrieves the current Google Cloud project ID and inserts it into the Collector config file.
* Add copyright header
Explicitly specifying versions of GRPC and OTel libraries until the OTel libraries are officially released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great progress, @arbrown! Thank you!
I left a few notes and there is also a general note:
- We need to update the architecture diagram for the demo app to reflect the fact that we're using a collector to capture cartservice traces
- We should add a readme with dive-in architecture of cart service in the root folder of cart service code. I'm familiar with collector/receiver nomenclature, but folks who are not connected to OpenTelemetry might find it hard to follow. The readme should clarify the components used to capture telemetry, their role and key configuration considerations.
Since your current PR is quite large, maybe we should do (1) and (2) as separate PRs.
exporters: | ||
otlp: | ||
endpoint: "opentelemetrycollector.default.svc.cluster.local:4317" | ||
insecure: true | ||
logging: | ||
loglevel: debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Sandbox is educational tool, please add extensive comments on the meaning of different fields you use for configuring collector in yaml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I simplified the yaml and added explanatory comments where I thought it was appropriate. Please let me know if there are other parts you think need additional explanation.
src/cartservice/docker-compose.yaml
Outdated
image: "redis:alpine" | ||
otel-agent: | ||
image: "otel/opentelemetry-collector-contrib-dev:latest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I pin the redis image as well? It looks like it's been on redis:alpine this whole time. Looks like we could pin it to redis:6.2-alpine3.13 which is where redis:alpine sits now.
Pin version to 0.28.0 instead of latest in case of future breaking changes. Remove dev version of image for performance reasons.
Dependencies had been pinned to older versions because of a bug in OpenTelemetry's instrumentation library, which has since been fixed. Upgraded GRPC version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @arbrown!
Thank you!
Adds automatic grpc trace to cartservice
Adds sidecar deployment of OpenTelemetry collector to existing cartservice deployment
Adds new OpenTelemetry collector deployment to collect trace information from cartservice (and potentially other services in the future)