Prometheus scrape metrics dotnet-monitor

1/11/2022

I am trying to configure for my services in kubrnetes using dotnet-monitor. I am using this manual https://dev.to/dotnet/inspecting-application-metrics-with-dotnet-monitor-3bg7. And it works as I can see the metrics on port 52323. Could you tell me how to set up scrape prometheus to collect metrics from the entire namespace and by port 52323.

I tried adding to the deployment annotations, but it didn’t work.

annotations:
  prometheus.io/scrape: 'true'
  prometheus.io/port: '52323'

This article suggests adding a section, but how can I configure it for several of my services?https://dotnetos.org/blog/2021-11-22-dotnet-monitor-grafana/

- job_name: memoryleak
  honor_timestamps: true
  scrape_interval: 2s
  scrape_timeout: 2s
  metrics_path: /metrics
  scheme: http
  static_configs:
  - targets:
    - localhost:52323
-- Vitalii Fedorenko
.net
kubernetes
prometheus
prometheus-node-exporter

0 Answers