-
Notifications
You must be signed in to change notification settings - Fork 4k
feat: implement otlp prom exporter #24158
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
Changes from 3 commits
ea63eac
c373791
3dc7abf
38664e2
cbc1c77
c05a3a5
0cd6572
7472934
527a99a
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 |
---|---|---|
|
@@ -90,6 +90,12 @@ type Config struct { | |
// DatadogHostname defines the hostname to use when emitting metrics to | ||
// Datadog. Only utilized if MetricsSink is set to "dogstatsd". | ||
DatadogHostname string `mapstructure:"datadog-hostname"` | ||
|
||
// Otlp Exporter fields | ||
OtlpExporterEnabled bool `mapstructure:"otlp-exporter-enabled"` | ||
OtlpCollectorGrpcAddr string `mapstructure:"otlp-collector-grpc-addr"` | ||
PrometheusEndpoint string `mapstructure:"prometheus-endpoint"` | ||
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 feels like this will need to be automatically populated based on what the configured prometheus metrics endpoint is? 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. Yeah, each chain should probably set their own defaults. |
||
OtlpServiceName string `mapstructure:"otlp-service-name"` | ||
} | ||
|
||
// Metrics defines a wrapper around application telemetry functionality. It allows | ||
|
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.
🛠️ Refactor suggestion
Exporter is started without lifecycle management or error propagation
StartOtlpExporter
(1) blocks fatal‑logging on failure and (2) launches a goroutine that never stops.Starting it here means:
graceDuration
, tests, etc.).telemetry.New
registers the Prom sink.Recommend returning a cancel/cleanup func and wiring it into the existing
errgroup
, then starting aftertelemetry.New
: