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

Group prometheus metrics #72

Merged
merged 17 commits into from
Mar 1, 2024
Merged

Group prometheus metrics #72

merged 17 commits into from
Mar 1, 2024

Conversation

muphblu
Copy link
Contributor

@muphblu muphblu commented Feb 21, 2024

Changes

  • removed MetricsServiceName and summaryName(class name) from metric's name, also removed MetricsServiceName from MetricsOptions
  • now metrics has common prefix common_metric_
  • two new factory methods added for RabbitMq and Custom
  • removed factory method for ExternalHttpClient - it didn't worked and used only in MetricsHtttpClientWrapper
  • removed metric collection from MetricsHtttpClientWrapper, it didn't worked;
    adding metrics to MetricsHtttpClientWrapper requires passing urlTemplate, serviceName and possibility to disable them, otherwise it duplicates metrics from ConsulMetricsHttpClientWrapper
  • added new extension method AddAtiMetrics - alias for AddMetrics, cause this one conflicts with Microsoft.Extensions.DependencyInjection.MetricsServiceExtensions.AddMetrics starting .net7
  • removed client-header-name from controller metrics, it was temporary fallback in case of absence X-Client-Name header
  • removed LangVersion, now it's bound to dotnet version
  • updated prometheus-net to v8.2.1 due to bug that was fixed in v8.1.1
  • updated Microsoft.Data.SqlClient to v5.2.0 due to bug
  • updated setting TrustServerCertificate in sql connection string is ignored and is true by default, could be overriden through DataBaseOptions

Comparison with previous

For example previous http metrics:

  • default_nameXzibitServiceAdapter{}
  • default_nameAuthorizationAdapter{}
  • default_nameMarshakAdapter{} and so on

Became one metric: common_metric_http_client{__name__ = "class_name_here"}

New metrics list

common_metric_sql 
common_metric_http_client - for outgoing http requests, ConsulMetricsHttpClientWrapper uses it
common_metric_rabbitmq_in - incoming messages from rmq, used by ATI.Services.RabbitMQ and ChangeTracking
common_metric_rabbitmq_out - outgoing messages to rmq
common_metric_repository
common_metric_controller - incoming http requests, added by MeasureAttribute
common_metric_Exceptions
common_metric_HttpStatusCodeCounter - response codes
common_metric_redis
common_metric_mongo
common_metric_{something} - this one reserved for custom metric, if you really need it, try to keep number of unique metrics as low as possible

@muphblu muphblu merged commit 0e1ed49 into master Mar 1, 2024
2 checks passed
@muphblu muphblu deleted the group-metrics branch March 1, 2024 09:53
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

Successfully merging this pull request may close these issues.

2 participants