Help configuring otelcol.connector.spanlogs #728
Replies: 1 comment 2 replies
-
Hello! I think you probably need to set |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am having some trouble getting the "spanlogs" connector to log out the status code of the span (expecting to see unset/error/etc). I tried adding a few variations of "status"/"statusCode"/etc to the span_attributes block, but had no luck. Its referenced in the docs, so I assume its possible: https://grafana.com/docs/alloy/latest/reference/components/otelcol.connector.spanlogs/#overrides-block
Can someone help me with the required config to log out the status code of each root span?
here is an example log:
{"body":"span="GET *" dur=9354677ns svc=MY-APP-DEV tid=8cec3ecf788fa75c091d0ffa6bb80c34","attributes":{"traces":"root"}}
I did also try enable non-root span logging, which looked like this
{"body":"span="GET *" dur=21294774ns svc=MY-APP-DEV tid=b42e9958867c69f302d41e613cf21f70","attributes":{"traces":"span"}}
// Process root level spans into logs
otelcol.connector.spanlogs "log_traces" {
spans = false
roots = true
processes = false
span_attributes = [
"status",
"code",
"status_code",
"statusCode",
"StatusCode",
]
output {
logs = [otelcol.exporter.loki.span_logs.input]
}
}
// Push logs to loki
otelcol.exporter.loki "span_logs" {
forward_to = [loki.write.push_logs.receiver]
}
loki.write "push_logs" {
endpoint {
url = "http://localhost:3100/loki/api/v1/push"
}
}
Beta Was this translation helpful? Give feedback.
All reactions