-
Notifications
You must be signed in to change notification settings - Fork 0
fix: log format doesn't uphold opentelemetry field naming (MAPCO-8460) #17
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
2bc017e
a46320f
0b756e5
538358b
0aaf0b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,42 +6,51 @@ log_format main escape=json | |||||
| '{' | ||||||
| '"Timestamp":$nanosec,' | ||||||
| '"Attributes":{' | ||||||
| '"mapcolonies.time_local":"$time_local",' | ||||||
| '"mapcolonies.time_local": "$time_local",' | ||||||
| {{ if .Values.authorization.enabled }} | ||||||
| '"mapcolonies.http.auth.token.client_name":"$jwt_payload_sub",' | ||||||
| '"mapcolonies.http.auth.token.client_name": "$jwt_payload_sub",' | ||||||
| {{ end }} | ||||||
| '"http.request.method":"$request_method",' | ||||||
| '"http.request.header.referer":"$http_referer",' | ||||||
| '"http.request.body.size":"$content_length",' | ||||||
| '"http.response.body.size":"$body_bytes_sent",' | ||||||
| '"http.response.header.x_forwarded_for":"$proxy_add_x_forwarded_for",' | ||||||
| '"http.response.status_code":"$status",' | ||||||
| '"user_agent.original":"$http_user_agent",' | ||||||
| '"network.protocol":"$server_protocol",' | ||||||
| '"mapcolonies.request_time":"$request_time",' | ||||||
| '"mapcolonies.http.upstream_connect_time":"$upstream_connect_time",' | ||||||
| '"mapcolonies.http.upstream_response_time":"$upstream_response_time",' | ||||||
| '"mapcolonies.http.upstream_addr":"$upstream_addr",' | ||||||
| '"mapcolonies.http.upstream_status_code":"$upstream_status",' | ||||||
| '"mapcolonies.http.upstream_cache_status":"$upstream_cache_status",' | ||||||
| '"mapcolonies.server":"$hostname",' | ||||||
| '"server.address":"$host",' | ||||||
| '"server.port":"$server_port",' | ||||||
| '"client.address":"$remote_addr",' | ||||||
| '"client.port":"$remote_port",' | ||||||
| '"url.scheme":"$scheme",' | ||||||
| '"url.path":"$uri",' | ||||||
| '"url.full":"$request_uri"' | ||||||
| '"http.request.method": "$request_method",' | ||||||
| '"http.request.header.host": "$host",' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. according to the docs it should be in server address
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
|
||||||
| '"http.request.header.referer": "$http_referer",' | ||||||
| '"http.request.header.content-type": "$content_type",' | ||||||
| '"http.request.header.content-length": "$content_length",' | ||||||
| '"http.request.body.size": $request_length,' | ||||||
|
||||||
| '"http.request.size": $bytes_sent,' | ||||||
shimoncohen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| '"http.response.body.size": $body_bytes_sent,' | ||||||
| '"http.response.header.x_forwarded_for": "$proxy_add_x_forwarded_for",' | ||||||
| '"http.response.status_code": "$status",' | ||||||
| '"user_agent.original": "$http_user_agent",' | ||||||
| '"network.protocol.name": "$otel_network_protocol_name",' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not required according to the docs if its http (pretty sure its always http in our case)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably, but it won't hurt. |
||||||
| '"network.protocol.version": "$otel_network_protocol_version",' | ||||||
| '"mapcolonies.request_time": "$request_time",' | ||||||
| '"mapcolonies.http.upstream_addr": "$upstream_addr",' | ||||||
| '"mapcolonies.http.upstream_status_code": "$upstream_status",' | ||||||
| '"mapcolonies.http.upstream_connect_time": "$upstream_connect_time",' | ||||||
| '"mapcolonies.http.upstream_response_time": "$upstream_response_time",' | ||||||
| '"mapcolonies.http.upstream_response_length": $upstream_response_length,' | ||||||
|
||||||
| '"mapcolonies.http.upstream_bytes_sent": $upstream_bytes_sent,' | ||||||
| '"mapcolonies.http.upstream_bytes_received": $upstream_bytes_received,' | ||||||
| '"mapcolonies.http.upstream_cache_status": "$upstream_cache_status",' | ||||||
| '"host.name": "$hostname",' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. $hostname in nginx is for the server name (in the SERVER block)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the documentation:
It seems that this is the recieved value from |
||||||
| '"server.address": "$server_addr",' | ||||||
|
||||||
| '"server.address": "$server_addr",' | |
| '"server.address": "$host",' |


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.
@CptSchnitz , back in the days we tried to put mapcolonies custom fields under "mapcolonies" key, do you think we should put it in the body or message key ?