-
Notifications
You must be signed in to change notification settings - Fork 25
Add beholder.config.info metric #1769
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: main
Are you sure you want to change the base?
Conversation
|
👋 kirqz23, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
✅ API Diff Results - No breaking changes |
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.
Pull request overview
This PR adds a new beholder.config.info metric to track Beholder SDK configuration settings. The metric records configuration as attributes, making it easier to monitor which nodes are using specific features like log streaming.
Changes:
- Added
beholderConfigMetricfunction that creates an Int64Gauge metric to record Beholder configuration - Integrated the config metric recording during client initialization
- Exposed configuration settings for logging, message emitter, tracing, and metrics as metric attributes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| attribute.String("metric_compressor", cfg.MetricCompressor), | ||
| } | ||
|
|
||
| configGauge.Record(context.Background(), 1, otelmetric.WithAttributes(configAttrs...)) |
Copilot
AI
Jan 13, 2026
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.
Using context.Background() for metric recording may prevent proper cancellation and timeout handling. Consider accepting a context parameter in beholderConfigMetric() and passing it from NewGRPCClient() to allow proper context propagation.
| configGauge.Record(context.Background(), 1, otelmetric.WithAttributes(configAttrs...)) | |
| ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) | |
| defer cancel() | |
| configGauge.Record(ctx, 1, otelmetric.WithAttributes(configAttrs...)) |
| attribute.String("metric_compressor", cfg.MetricCompressor), | ||
| } | ||
|
|
||
| configGauge.Record(context.Background(), 1, otelmetric.WithAttributes(configAttrs...)) |
Copilot
AI
Jan 13, 2026
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 gauge is recorded only once during initialization. Since gauges represent a point-in-time value that can change, consider using an async gauge (Int64ObservableGauge) or explicitly documenting that this is a one-time initialization metric that won't update if configuration changes at runtime.
This introduces
beholder.config.infometric that aggregates beholder settings as attributes and allows to track app configurationThis feature especially will help us understand which nodes are using logs streaming. Currently both custom events and logs are processed through the same intrumentation and gRPC built-in metrics with LogExporter are not specific.