feat: add openteletry metrics support for each backend #102
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.
This pull request introduces support for OpenTelemetry (OTLP) metrics endpoints across multiple backend components (
deviceDiscoveryBackend
,networkDiscoveryBackend
,workerBackend
, andpktvisorBackend
). It replaces the previous host/port configuration for OTLP with HTTP and gRPC endpoint URLs, ensuring more flexibility and consistency in configuration. Key changes include adding new fields for OTLP endpoints, updating configuration logic, and modifying startup commands to include OTLP-related options.OpenTelemetry (OTLP) Integration:
Added a new
diodeOtelEndpoint
field to thedeviceDiscoveryBackend
,networkDiscoveryBackend
, andworkerBackend
structs to store the gRPC OTLP endpoint. Updated theirConfigure
methods to set this field based on thecommon.Otel.Grpc
configuration and log the endpoint being used. Modified theStart
methods to append the--otel-endpoint
option to the startup arguments if the endpoint is configured. (device_discovery.go
: [1] [2] [3];network_discovery.go
: [4] [5] [6];worker.go
: [7] [8] [9]Updated the
pktvisorBackend
to parse and validate the OTLP HTTP endpoint URL (common.Otel.HTTP
) instead of using separate host and port fields. Extracted and logged the host and port from the URL during configuration. (pktvisor.go
: [1] [2]Configuration Schema Updates:
host
andport
fields in theBackendCommons.Otel
configuration withgrpc
andhttp
fields to support full endpoint URLs for OTLP metrics. (types.go
: agent/config/types.goL71-R72)