{"action":"opened","issue":{"url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/400","repository_url":"https://api.github.com/repos/AppMetrics/AppMetrics","labels_url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/400/labels{/name}","comments_url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/400/comments","events_url":"https://api.github.com/repos/AppMetrics/AppMetrics/issues/400/events","html_url":"https://github.com/AppMetrics/AppMetrics/issues/400","id":425344774,"node_id":"MDU6SXNzdWU0MjUzNDQ3NzQ=","number":400,"title":"Allow overriding ContextName for default metrics","user":{"login":"tdabasinskas","id":7723360,"node_id":"MDQ6VXNlcjc3MjMzNjA=","avatar_url":"https://avatars0.githubusercontent.com/u/7723360?v=4","gravatar_id":"","url":"https://api.github.com/users/tdabasinskas","html_url":"https://github.com/tdabasinskas","followers_url":"https://api.github.com/users/tdabasinskas/followers","following_url":"https://api.github.com/users/tdabasinskas/following{/other_user}","gists_url":"https://api.github.com/users/tdabasinskas/gists{/gist_id}","starred_url":"https://api.github.com/users/tdabasinskas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdabasinskas/subscriptions","organizations_url":"https://api.github.com/users/tdabasinskas/orgs","repos_url":"https://api.github.com/users/tdabasinskas/repos","events_url":"https://api.github.com/users/tdabasinskas/events{/privacy}","received_events_url":"https://api.github.com/users/tdabasinskas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-03-26T10:45:28Z","updated_at":"2019-03-26T10:45:28Z","closed_at":null,"author_association":"NONE","body":"Looking into the source code, it seems that `Application` prefix for context names [is hardcoded](\r\nhttps://github.com/AppMetrics/AspNetCore/blob/master/src/App.Metrics.AspNetCore.Core/Internal/HttpRequestMetricsRegistry.cs#L20):\r\n\r\n```chsharp\r\n public static string ContextName = \"Application.HttpRequests\";\r\n```\r\n\r\n[Prometheus provides the guidelines for naming the metrics](https://prometheus.io/docs/practices/naming/) and one of the things these guidelines states is the following:\r\n\r\n> A metric name. should have a (single-word) application prefix relevant to the domain the metric belongs to. The prefix is sometimes referred to as namespace by client libraries. For metrics specific to an application, the prefix is usually the application name itself. Sometimes, however, metrics are more generic, like standardized metrics exported by client libraries. Examples:\r\n    - prometheus_notifications_total (specific to the Prometheus server)\r\n    - process_cpu_seconds_total (exported by many client libraries)\r\n    - http_request_duration_seconds (for all HTTP requests)\r\n\r\nThe hardcoded `Application` prefix for the metrics makes this somehow incompliant with the guidelines.\r\n\r\nWould it be possible to support overriding of this, similarly it is possible to do with the custom metrics via `options.DefaultContextLabel`?"}}
{"actor":{"display_login":"tdabasinskas"}}