Azure / secrets-store-csi-driver-provider-azure

Azure Key Vault provider for Secret Store CSI driver allows you to get secret contents stored in Azure Key Vault instance and use the Secret Store CSI driver interface to mount them into Kubernetes pods.
https://azure.github.io/secrets-store-csi-driver-provider-azure/
MIT License
441 stars 193 forks source link

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

Closed AlexanderStocks closed 1 week ago

AlexanderStocks commented 2 months ago

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

Issue Fixed:

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

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