From 4889702e631f052faf58003ca3b121bf593ec841 Mon Sep 17 00:00:00 2001 From: Bastian Krol Date: Thu, 19 Sep 2024 11:51:18 +0200 Subject: [PATCH] docs(readme): update documentation on service name auto-detection --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 405702f..5f8920f 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,15 @@ Configuration ### DASH0_AUTOMATIC_SERVICE_NAME -If no `OTEL_SERVICE_NAME` has been set, a service name is automatically derived by reading the main `package.json` file -(if it is present) as `${packageJson.name}@${packageJson.version}`. -This can be disabled either by setting `OTEL_SERVICE_NAME` or by setting `DASH0_AUTOMATIC_SERVICE_NAME=false`. +If no service name has been set, a service name and a service version are automatically derived by reading the main `package.json` file +(if it is present): +* The `service.name` resource attribute will be set to the value of the `name` attribute found in the `package.json` file. +* The `service.version` resource attribute will be set to the value of the `version` attribute found in the `package.json` file. + +This behavior can be disabled either +* by setting an explicit service name using the `OTEL_SERVICE_NAME` environment variable, +* by setting an explicit service name using the `OTEL_RESOURCE_ATTRIBUTES` environment variable (using the `service.name` attribute key), or +* by setting the environment variable `DASH0_AUTOMATIC_SERVICE_NAME=false`. ### DASH0_BOOTSTRAP_SPAN