Prometheus .Net Core Client Library

Introduction

The Prometheus .Net Core client library is a .NET Core metrics library. Versions 4.0, 5.0 and 6.0 are supported by Instana.

Instana will automatically detect the Prometheus .Net Core Client library, and the metrics are shown on the .NET Core process dashboard.

Screenshot: Prometheus .Net Core Client Metrics

Configuration

All configuration options are optional. Instana does not monitor metrics from the Prometheus .NET Core client library by default configuration, it should be turned on manually.

However, you can overwrite the defaults by adding a prometheusMetricCollection section under com.instana.plugin.netcore in your agent's configuration.yaml file, as illustrated in the following example:

com.instana.plugin.netcore:
  prometheusMetricCollection:
    enabled: true
    limit: 200
    pollIntervalSeconds: 15
    excludeMetricNamesStartingWith:
      - dotnet
      - process
    excludeMetricsMatching:
      - eu-central-1

The following configuration options are supported:

  • enabled: Set this to false in order to disable monitoring of the Prometheus .Net Core Client library. Default: false.

  • limit: In order to avoid overload of the monitoring backend, we limit the number of metrics per .Net Core process. You can use this configuration option to change the limit. Default: 200.

  • pollIntervalSeconds: In general Instana offers 1 second resolution for metrics. In order to avoid potential overload of custom callbacks, we increased the poll interval for metrics from the Prometheus .Net Core client library to 15 seconds by default. Use this configuration option to increase or decrease the poll interval. Default: 15.

  • excludeMetricNamesStartingWith: List of metric name prefixes that should not be monitored. For example, the configuration above would exclude all metrics starting with dotnet and all metrics starting with process, so you would not be able to see the following metrics:

    process_cpu_seconds_total 0.99
    process_open_fds 23.0
    dotnet_total_memory_bytes 13.07M
    ```* `includeMetricNamesStartingWith`: Counterpart to `excludeMetricNamesStartingWith`. Only metrics starting with one of these prefixes will be included.
    
  • excludeMetricsMatching: This is a more powerful alternative to excludeMetricNamesStartingWith: All metrics matching one of the list of regular expressions will be excluded. The regular expression is applied to the full metric string including labels, like counter_total{region="eu-central-1"}, not just to the metric name. The regular expression is not anchored, i.e. it can match anywhere in the middle of the string. For example, if you specify eu-central-1 in the excludeMetricsMatching list, the metric counter_total{region="eu-central-1"} will be excluded.

  • includeMetricsMatching: Counterpart to excludeMetricsMatching. Only metrics matching one of the regular expressions in the list will be included, all other metrics will be excluded.