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

Adding additional labels for service monitor prometheus or adding to dapr service in automatic sidecar injection #8275

Open
aytemuryakup opened this issue Nov 13, 2024 · 0 comments

Comments

@aytemuryakup
Copy link

Hi,

To monitor Dapr sidecar metrics with the help of prometheus Service Monitor, we use the Selector Labels field.

For Example,

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: demo-dapr-sidecars-metrics
  labels:
    release: prometheus
spec:
  selector:
    matchLabels:
      dapr.io/enabled: 'true'
  endpoints:
    - port: dapr-metrics
      interval: 30s
      path: /
  namespaceSelector:
    matchNames:
      - demo-apps

When metrics are opened for more than one service and we want to monitor only specific services, the labels definition must be unique.
But in k8s service that occurs after dapr sidecar injection, it assigns only one label as below.

apiVersion: v1
kind: Service
metadata:
  name: demo-service-dapr
  namespace: demo-apps
  labels:
    dapr.io/enabled: 'true'
  annotations:
    dapr.io/app-id: demo-service
    prometheus.io/path: /
    prometheus.io/port: '9090'
    prometheus.io/probe: 'true'
    prometheus.io/scrape: 'true'

Can the automatic value assignment with annotations value also be done to the sidecar service-dapr?

dapr.io/app-id: demo-service

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

No branches or pull requests

1 participant