-
Notifications
You must be signed in to change notification settings - Fork 0
Add OpenTelemetry distributed tracing support via ngx_otel_module
module
#20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3b870cb
to
427dbb1
Compare
ngx_otel_module
module
427dbb1
to
cf25e11
Compare
cf25e11
to
0aede32
Compare
pipelines: | ||
traces: | ||
exporters: | ||
- 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.
This cause the collector to log. I used it to confirm the proxy to collector connection before I set up Jaeger to view the trace.
otel_trace on; | ||
otel_service_name example_service:nginx; | ||
otel_trace_context propagate; | ||
otel_exporter { | ||
endpoint otel-collector:4317; | ||
interval 5s; | ||
batch_size 512; | ||
batch_count 4; | ||
} | ||
|
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.
These don't have to be here. Some like otel_trace
& otel_trace_context
can be located elsewhere i.e. in the location
block.
add_header X-Proxy-Request-Time $request_time; | ||
|
||
# Observability headers | ||
add_header X-Trace-ID $otel_trace_id; |
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.
The advantage of having a proxy everywhere is we can set headers like this. Figured it would be nice to have this available in the response (which also means it's in the browser too)!
interval 5s; | ||
batch_size 512; | ||
batch_count 4; |
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.
These are the defaults.
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've skimmed. I'll need to come back and read documentation more closely when I have time, but it looks okay 👍
The module supports W3C context propagation and OTLP/gRPC export protocol. See updated example and tests below. To note, when enabled, the following span attributes are added automatically:
http.method
http.target
http.route
http.scheme
http.flavor
http.user_agent
http.request_content_length
http.response_content_length
http.status_code
net.host.name
net.host.port
net.sock.peer.addr
net.sock.peer.port
Testing
Build and start up the services ...
Make a request ...
Inspect the logs ...
Trace should now be available in Jaeger ...
References