-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Olivierg/gateway usage gauge #37499
base: main
Are you sure you want to change the base?
Olivierg/gateway usage gauge #37499
Conversation
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.24.0 | ||
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.24.0 | ||
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.24.0 | ||
github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.24.1-0.20250124131402-bcd6fd1617a6 |
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.
Please make a new release of mapping-go after your other PR is merged
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 needs a changelog too
@@ -67,6 +69,17 @@ func DefaultMetrics(exporterType string, hostname string, timestamp uint64, tags | |||
return metrics | |||
} | |||
|
|||
// GatewayUsageGauge creates a gauge metric to report is there is a gateway | |||
func GatewayUsageGauge(timestamp uint64, hostname string, tags []string, gatewayUsage *attributes.GatewayUsage) datadogV2.MetricSeries { | |||
series := NewGauge("datadog.otel.gateway", timestamp, gatewayUsage.Gauge(), tags) |
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.
What if the gateway host is from traces, metrics and logs, does this gauge report value of 3?
Description
This PR adds a new gauge metric
datadog.otel.gateway
. This metric is set at1
when the collector is used as a gateway otherwise, the value is0
.If
datadog.host.name
was sent with two different values, then the collector is used as a gateway.Note: The PR on opentelemetry-mapping-go should be merged before this PR and
go.mod
must use a commit on main instead of0.24.1-0.20250124131402-bcd6fd1617a6
Associated PRs:
Link to tracking issue
Fixes
Testing
The following commands generates the metric
datadog.otel.gateway
at1
Same tests were performed for
traces
and forlogs
whenisLogsAgentExporterEnabled
is false.Documentation