From 2afe81c88e7e4b0e11af2c30ba1b2fc5f5a707dc Mon Sep 17 00:00:00 2001 From: Jack Shirazi Date: Wed, 3 Jul 2024 13:05:30 +0100 Subject: [PATCH 1/2] add config redirect for global-labels --- .../co/elastic/otel/config/LegacyConfigurations.java | 4 +++- docs/configure.mdx | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/custom/src/main/java/co/elastic/otel/config/LegacyConfigurations.java b/custom/src/main/java/co/elastic/otel/config/LegacyConfigurations.java index 7b57093a..d8d27277 100644 --- a/custom/src/main/java/co/elastic/otel/config/LegacyConfigurations.java +++ b/custom/src/main/java/co/elastic/otel/config/LegacyConfigurations.java @@ -71,6 +71,9 @@ private void addAllOptions() { addDocumentationOption( "environment", "The Elastic [`environment`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-environment) option corresponds to setting the `deployment.environment` key in [OTEL_RESOURCE_ATTRIBUTES](https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_resource_attributes). For example: `OTEL_RESOURCE_ATTRIBUTES=deployment.environment=testing`."); + addDocumentationOption( + "global_labels", + "The Elastic [`global_labels`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-global-labels) option corresponds to adding `key=value` comma separated pairs in [OTEL_RESOURCE_ATTRIBUTES](https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_resource_attributes). For example: `OTEL_RESOURCE_ATTRIBUTES=alice=first,bob=second`. Such labels will result in labels.key=value attributes on the server, eg labels.alice=first"); addUnspecifiedOption("log_level"); addUnspecifiedOption("log_file"); addUnspecifiedOption("log_file_size"); @@ -99,7 +102,6 @@ private void addAllOptions() { addUnspecifiedOption("capture_exception_details"); addUnspecifiedOption("capture_body"); addUnspecifiedOption("capture_headers"); - addUnspecifiedOption("global_labels"); addUnspecifiedOption("enable_type_pool_cache"); addUnspecifiedOption("instrument_ancient_bytecode"); addUnspecifiedOption("warmup_byte_buddy"); diff --git a/docs/configure.mdx b/docs/configure.mdx index 7de156e1..66b8f4f8 100644 --- a/docs/configure.mdx +++ b/docs/configure.mdx @@ -24,6 +24,7 @@ Click on a key to get more information. * [`enabled`](#enabled) * [`service_version`](#service_version) * [`environment`](#environment) +* [`global_labels`](#global_labels) ## Elastic to OpenTelemetry mapping @@ -35,7 +36,7 @@ The Elastic [`server_url`](https://www.elastic.co/guide/en/apm/agent/java/curren ### `server_urls` -The Elastic [`server_urls`](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-server-urls) option has no equivalent OpenTelemetry option—you can only specify one endpoint. Use [OTEL_EXPORTER_OTLP_ENDPOINT](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_endpoint) instead. +The Elastic [`server_urls`](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-server-urls) option has no equivalent OpenTelemetry option—you can only specify one endpoint. Use [OTEL_EXPORTER_OTLP_ENDPOINT](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_endpoint) instead. {/* This file is auto-generated. Please make changes in *Configuration.java (for example, CoreConfiguration.java) and execute ConfigurationExporter. */} @@ -75,6 +76,12 @@ The Elastic [`environment`](https://www.elastic.co/guide/en/apm/agent/java/curre {/* This file is auto-generated. Please make changes in *Configuration.java (for example, CoreConfiguration.java) and execute ConfigurationExporter. */} +### `global_labels` + +The Elastic [`global_labels`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-global-labels) option corresponds to adding `key=value` comma separated pairs in [OTEL_RESOURCE_ATTRIBUTES](https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_resource_attributes). For example: `OTEL_RESOURCE_ATTRIBUTES=alice=first,bob=second`. Such labels will result in labels.key=value attributes on the server, eg labels.alice=first + +{/* This file is auto-generated. Please make changes in *Configuration.java (for example, CoreConfiguration.java) and execute ConfigurationExporter. */} + {/* Elastic to OpenTelemetry mapping */} From 6bedd18069cc093c9f666bea8e39dd8592fe9ff0 Mon Sep 17 00:00:00 2001 From: Jack Shirazi Date: Wed, 3 Jul 2024 13:28:10 +0100 Subject: [PATCH 2/2] fix config break --- .../main/java/co/elastic/otel/config/LegacyConfigurations.java | 2 +- docs/configure.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom/src/main/java/co/elastic/otel/config/LegacyConfigurations.java b/custom/src/main/java/co/elastic/otel/config/LegacyConfigurations.java index d8d27277..b4dd55c8 100644 --- a/custom/src/main/java/co/elastic/otel/config/LegacyConfigurations.java +++ b/custom/src/main/java/co/elastic/otel/config/LegacyConfigurations.java @@ -52,7 +52,7 @@ private void addAllOptions() { "The Elastic [`server_url`](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-server-url) option corresponds to the OpenTelemetry [`OTEL_EXPORTER_OTLP_ENDPOINT`](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_endpoint) option."); addDocumentationOption( "server_urls", - "The Elastic [`server_urls`](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-server-urls) option has no equivalent OpenTelemetry option—you can only specify one endpoint. Use [OTEL_EXPORTER_OTLP_ENDPOINT](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_endpoint) instead."); + "The Elastic [`server_urls`](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-server-urls) option has no equivalent OpenTelemetry option - you can only specify one endpoint. Use [OTEL_EXPORTER_OTLP_ENDPOINT](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_endpoint) instead."); addDocumentationOption( "secret_token", "The Elastic [`secret_token`](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-secret-token) option corresponds to the OpenTelemetry [OTEL_EXPORTER_OTLP_HEADERS](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_headers) option. For example: `OTEL_EXPORTER_OTLP_HEADERS=\"Authorization=Bearer an_apm_secret_token\"`."); diff --git a/docs/configure.mdx b/docs/configure.mdx index 66b8f4f8..23dcc545 100644 --- a/docs/configure.mdx +++ b/docs/configure.mdx @@ -36,7 +36,7 @@ The Elastic [`server_url`](https://www.elastic.co/guide/en/apm/agent/java/curren ### `server_urls` -The Elastic [`server_urls`](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-server-urls) option has no equivalent OpenTelemetry option—you can only specify one endpoint. Use [OTEL_EXPORTER_OTLP_ENDPOINT](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_endpoint) instead. +The Elastic [`server_urls`](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-server-urls) option has no equivalent OpenTelemetry option - you can only specify one endpoint. Use [OTEL_EXPORTER_OTLP_ENDPOINT](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_endpoint) instead. {/* This file is auto-generated. Please make changes in *Configuration.java (for example, CoreConfiguration.java) and execute ConfigurationExporter. */}