Skip to content
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

feat: Add otlp metrics exporter and update prom exporter #1649

Conversation

AlexanderStocks
Copy link

@AlexanderStocks AlexanderStocks commented Sep 6, 2024

Reason for Change:

This adds the otlp exporter with the environment variables required to configure strato, or any other generic grpc endpoint.
This also updates the otel library which includes breaking changes to the Prometheus exporter

Requirements

  • squashed commits
  • included documentation
  • added unit tests and e2e tests (if applicable).

Issue Fixed:

Fixes #1647
Does this change contain code from or inspired by another project?

  • Yes
  • No

If "Yes," did you notify that project's maintainers and provide attribution?
Its my code.
Special Notes for Reviewers:

Output from /metrics:

# HELP grpc_request Distribution of how long it took for the gRPC requests
# TYPE grpc_request histogram
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.1"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.2"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.3"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.4"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.5"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="1"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="1.5"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="2"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="2.5"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="3"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="5"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="10"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="15"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="30"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="+Inf"} 1
grpc_request_sum{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure"} 0.000118976
grpc_request_count{grpc_code="OK",grpc_message="",grpc_method="/grpc.health.v1.Health/Check",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.1"} 0
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.2"} 0
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.3"} 0
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.4"} 0
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.5"} 0
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="1"} 1
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="1.5"} 2
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="2"} 2
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="2.5"} 2
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="3"} 2
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="5"} 2
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="10"} 2
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="15"} 2
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="30"} 2
grpc_request_bucket{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="+Inf"} 2
grpc_request_sum{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure"} 2.2844812670000003
grpc_request_count{grpc_code="OK",grpc_message="",grpc_method="/v1alpha1.CSIDriverProvider/Mount",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure"} 2
# HELP keyvault_request Distribution of how long it took to get from keyvault
# TYPE keyvault_request histogram
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.1"} 0
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.2"} 0
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.3"} 0
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.4"} 0
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="0.5"} 0
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="1"} 1
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="1.5"} 2
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="2"} 2
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="2.5"} 2
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="3"} 2
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="5"} 2
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="10"} 2
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="15"} 2
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="30"} 2
keyvault_request_bucket{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure",le="+Inf"} 2
keyvault_request_sum{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure"} 2.282627427
keyvault_request_count{error="",object_name="bugbash23sscontrolleras",object_type="secret",os_type="linux",otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version="",provider="azure",service_name="csi-secrets-store-provider-azure"} 2
# HELP otel_scope_info Instrumentation Scope metadata
# TYPE otel_scope_info gauge
otel_scope_info{otel_scope_name="csi-secrets-store-provider-azure",otel_scope_version=""} 1
# HELP promhttp_metric_handler_errors_total Total number of internal errors encountered by the promhttp metric handler.
# TYPE promhttp_metric_handler_errors_total counter
promhttp_metric_handler_errors_total{cause="encoding"} 0
promhttp_metric_handler_errors_total{cause="gathering"} 0
# HELP target_info Target metadata
# TYPE target_info gauge
target_info{service_name="unknown_service:secrets-store-csi-driver-provider-azure",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.29.0"} 1

Undo makefile changes
@nilekhc nilekhc changed the title Feat: Add otlp metrics exporter and update prom exporter feat: Add otlp metrics exporter and update prom exporter Sep 30, 2024
Copy link
Contributor

@nilekhc nilekhc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide metrics output from grpc endpoint? is it same as in pr description?

pkg/metrics/otlp_exporter.go Outdated Show resolved Hide resolved
pkg/metrics/otlp_exporter.go Outdated Show resolved Hide resolved
pkg/metrics/otlp_exporter.go Outdated Show resolved Hide resolved
pkg/metrics/otlp_exporter.go Outdated Show resolved Hide resolved
pkg/metrics/otlp_exporter.go Outdated Show resolved Hide resolved
pkg/metrics/otlp_exporter.go Show resolved Hide resolved
Propagate params. Use secure tls.
@AlexanderStocks AlexanderStocks deleted the astocks/Add-otlp-metrics-exporter branch November 19, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Add Otlp metrics exporter to enable Strato Integration
2 participants