Skip to content

Commit

Permalink
Rename beyla_build_info
Browse files Browse the repository at this point in the history
  • Loading branch information
marctc committed Aug 29, 2024
1 parent e98ffbf commit 05ced0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/sources/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ Beyla can be [configured to report internal metrics]({{< relref "./configure/opt
| `beyla_otel_trace_export_errors_total` | CounterVec | Error count on each failed OTEL trace export, by error type |
| `beyla_prometheus_http_requests_total` | CounterVec | Number of requests towards the Prometheus Scrape endpoint, faceted by HTTP port and path |
| `beyla_instrumented_processes` | GaugeVec | Instrumented processes by Beyla, with process name |
| `beyla_build_info` | GaugeVec | Version information of the Beyla binary, including the build time and commit hash |
| `beyla_internal_build_info` | GaugeVec | Version information of the Beyla binary, including the build time and commit hash |
2 changes: 1 addition & 1 deletion grafana/beyla.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "beyla_build_info",
"expr": "beyla_internal_build_info",
"format": "table",
"instant": true,
"legendFormat": "__auto",
Expand Down
12 changes: 4 additions & 8 deletions pkg/internal/imetrics/iprom.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewPrometheusReporter(cfg *PrometheusConfig, manager *connector.PrometheusM
Help: "Instrumented processes by Beyla",
}, []string{"process_name"}),
beylaInfo: prometheus.NewGauge(prometheus.GaugeOpts{
Name: "beyla_build_info",
Name: "beyla_internal_build_info",
Help: "A metric with a constant '1' value labeled by version, revision, branch, " +
"goversion from which Beyla was built, the goos and goarch for the build.",
ConstLabels: map[string]string{
Expand All @@ -89,10 +89,8 @@ func NewPrometheusReporter(cfg *PrometheusConfig, manager *connector.PrometheusM
pr.otelTraceExports,
pr.otelTraceExportErrs,
pr.prometheusRequests,
pr.instrumentedProcesses)
// Using the registry here means that the metrics will be registered with the global prometheus registry
// Therefore, we won't register beyla_build_info as it's already registered in pkg/export/prom/prom.go
pr.beylaInfo = nil
pr.instrumentedProcesses,
pr.beylaInfo)
} else {
manager.Register(cfg.Port, cfg.Path,
pr.tracerFlushes,
Expand All @@ -112,9 +110,7 @@ func (p *PrometheusReporter) Start(ctx context.Context) {
if p.connector != nil {
p.connector.StartHTTP(ctx)
}
if p.beylaInfo != nil {
p.beylaInfo.Set(1)
}
p.beylaInfo.Set(1)
}

func (p *PrometheusReporter) TracerFlush(len int) {
Expand Down

0 comments on commit 05ced0f

Please sign in to comment.