Add networkobservability_build_info Prometheus metric#2064
Draft
Add networkobservability_build_info Prometheus metric#2064
Conversation
…nd OS labels Co-authored-by: nddq <28567936+nddq@users.noreply.github.com>
Co-authored-by: nddq <28567936+nddq@users.noreply.github.com>
Co-authored-by: nddq <28567936+nddq@users.noreply.github.com>
Co-authored-by: nddq <28567936+nddq@users.noreply.github.com>
Co-authored-by: nddq <28567936+nddq@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Prometheus metric for retina build info
Add networkobservability_build_info Prometheus metric
Feb 14, 2026
Retina Code Coverage ReportTotal coverage no changeIncreased diff
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements
networkobservability_build_infometric following Prometheus build_info conventions. Metric exposes build metadata as labels with constant value of 1.Implementation
networkobservability_build_info{version="v0.0.17",architecture="amd64",os="linux"} 1version: frombuildinfo.Version(ldflags injection) with "unknown" fallbackarchitecture: fromruntime.GOARCHos: fromruntime.GOOSmetrics.InitializeMetrics()at daemon startupCode Changes
pkg/metrics/types.go: BuildInfo gauge and BuildInfoDescription constantpkg/metrics/metrics.go: Metric creation and initialization with runtime valuespkg/utils/metric_names.go: BuildInfoName constantpkg/utils/attr_utils.go: BuildVersion, BuildArchitecture, BuildOS label constantspkg/metrics/metrics_test.go: Test validation of metric value and labelsRelated Issue
Addresses feature request for build info metric exposure.
Checklist
git commit -S -s ...). See this documentation on signing commits.Screenshots (if applicable) or Testing Completed
Metric output verified via test:
Unit tests pass with metric value and label validation.
Additional Notes
Version label uses "unknown" in test/dev builds. Production builds populate version via ldflags during build process.
Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/microsoft/retina/releases/latest/usr/bin/curl curl -s REDACTED git conf�� G1dG6bKHw credential.usern-ifaceassert tnet/tools/bash(http block)/usr/bin/curl curl -s REDACTED x64/pkg/include ortc�� x64/src/runtime/-p x64/src/internalgo.uber.org/zap(http block)Co-authored-by: nddq <28567936+nddq@users.noreply.github.com> -E th-securejoin@v0.5.1/deprecated_linux.go th-securejoin@v0.5.1/doc.go x64/pkg/tool/linux_amd64/compile entpools_client.git ild.go -imultiarch x64/pkg/tool/linux_amd64/compile` (http block)
Original prompt
retina_build_info#338💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.