You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-1
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ def api_handler():
89
89
90
90
Autometrics keeps track of instrumented functions calling each other. If you have a function that calls another function, metrics for later will include `caller` label set to the name of the autometricised function that called it.
91
91
92
-
####Metrics Libraries
92
+
## Metrics Libraries
93
93
94
94
Configure the package that autometrics will use to produce metrics with the `AUTOMETRICS_TRACKER` environment variable.
95
95
@@ -116,6 +116,17 @@ Configure the labels by setting the following environment variables:
116
116
117
117
This follows the method outlined in [Exposing the software version to Prometheus](https://www.robustperception.io/exposing-the-software-version-to-prometheus/).
118
118
119
+
## Service name
120
+
121
+
All metrics produced by Autometrics have a label called `service.name` (or `service_name` when exported to Prometheus) attached to identify the logical service they are part of.
122
+
123
+
You may want to override the default service name, for example if you are running multiple instances of the same code base as separate services and want to differentiate between the metrics produced by each one.
124
+
125
+
The service name is loaded from the following environment variables, in this order:
126
+
127
+
1.`AUTOMETRICS_SERVICE_NAME` (at runtime)
128
+
2.`OTEL_SERVICE_NAME` (at runtime)
129
+
119
130
## Exemplars
120
131
121
132
> **NOTE** - As of writing, exemplars aren't supported by the default tracker (`AUTOMETRICS_TRACKER=OPEN_TELEMETRY`).
f"""# TYPE function_calls_concurrent gauge\nfunction_calls_concurrent{{function="sleep",module="autometrics.tracker.test_concurrency"}} 1.0"""
40
+
f"""# TYPE function_calls_concurrent gauge\nfunction_calls_concurrent{{function="sleep",module="autometrics.tracker.test_concurrency",service_name="autometrics"}} 1.0"""
0 commit comments