From a6040f35e932e28113975dd02fdcf1a61e30f5b1 Mon Sep 17 00:00:00 2001 From: ralongit Date: Tue, 15 Oct 2024 09:23:50 +0300 Subject: [PATCH 1/3] Add Opentelemetry configurations steps for Span Metrics Collection --- docs/shipping/Other/opentelemetry.md | 90 ++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/docs/shipping/Other/opentelemetry.md b/docs/shipping/Other/opentelemetry.md index 260355ad..04a2ced1 100644 --- a/docs/shipping/Other/opentelemetry.md +++ b/docs/shipping/Other/opentelemetry.md @@ -218,6 +218,96 @@ Example configuration file: {@include: ../../_include/tracing-shipping/collector-config.md} +### Optional: Configure Span Metrics Collection + +Span metrics collection is disabled by default. To enable it, add & modify the following sections in the `config.yaml` OpenTelemetry configuration. +Replace `${LISTENER_URL}` with the Logz.io metrics listener URL and `${SPM_TOKEN}` with your Logz.io SPM metrics account token. +```yaml + connectors: + spanmetrics: + aggregation_temporality: AGGREGATION_TEMPORALITY_CUMULATIVE + dimensions: + - name: rpc.grpc.status_code + - name: http.method + - name: http.status_code + - name: cloud.provider + - name: cloud.region + - name: db.system + - name: messaging.system + - default: ${ENV_ID} + name: env_id + dimensions_cache_size: 100000 + histogram: + explicit: + buckets: + - 2ms + - 8ms + - 50ms + - 100ms + - 200ms + - 500ms + - 1s + - 5s + - 10s + metrics_expiration: 5m + resource_metrics_key_attributes: + - service.name + - telemetry.sdk.language + - telemetry.sdk.name + servicegraph: + latency_histogram_buckets: [2ms, 8ms, 50ms, 100ms, 200ms, 500ms, 1s, 5s, 10s] + dimensions: + - env_id + store: + ttl: 5s + max_items: 100000 + processors: + # Rename metrics and labels to match Logz.io's requirements + metricstransform/metrics-rename: + transforms: + - include: ^duration(.*)$$ + action: update + match_type: regexp + new_name: latency.$${1} + - action: update + include: calls + new_name: calls_total + metricstransform/labels-rename: + transforms: + - action: update + include: ^latency + match_type: regexp + operations: + - action: update_label + label: span.name + new_label: operation + - action: update + include: ^calls + match_type: regexp + operations: + - action: update_label + label: span.name + new_label: operation + exporters: + prometheusremotewrite/spm-logzio: + endpoint: ${LISTENER_URL} + headers: + Authorization: Bearer ${SPM_TOKEN} + user-agent: "{{ .Chart.Name }}-{{ .Chart.Version }}-helm" + timeout: 30s + add_metric_suffixes: false + service: + pipelines: + extensions: [health_check, pprof, zpages] + traces: + receivers: [otlp] + processors: [tail_sampling, batch] + exporters: [logzio/traces, servicegraph, spanmetrics] + metrics/spm-logzio: + receivers: [spanmetrics, servicegraph] + processors: [metricstransform/metrics-rename, metricstransform/labels-rename, batch] + exporters: [prometheusremotewrite/spm-logzio] +``` ### Instrument the application If your application isn't instrumented, begin by downloading the OpenTelemetry agent or library specific to your programming language. Logz.io supports popular open-source instrumentation libraries, including OpenTracing, Jaeger, OpenTelemetry, and Zipkin. Attach the agent, set up the necessary configuration options, and start your application. The agent will automatically instrument your application to capture telemetry data. From c8e70af3bd0472a4d619de2f31a42dfd2d3b7dcb Mon Sep 17 00:00:00 2001 From: ralongit Date: Tue, 15 Oct 2024 09:40:51 +0300 Subject: [PATCH 2/3] Update opentelemetry.md --- docs/shipping/Other/opentelemetry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shipping/Other/opentelemetry.md b/docs/shipping/Other/opentelemetry.md index 04a2ced1..bbd8e1f3 100644 --- a/docs/shipping/Other/opentelemetry.md +++ b/docs/shipping/Other/opentelemetry.md @@ -293,7 +293,7 @@ Replace `${LISTENER_URL}` with the Logz.io metrics listener URL and `${SPM_TOKEN endpoint: ${LISTENER_URL} headers: Authorization: Bearer ${SPM_TOKEN} - user-agent: "{{ .Chart.Name }}-{{ .Chart.Version }}-helm" + user-agent: "logzio-opentelemetry-apm" timeout: 30s add_metric_suffixes: false service: From 1400513f55dc063d0af58801e32408dbc077fd9e Mon Sep 17 00:00:00 2001 From: ralongit Date: Tue, 15 Oct 2024 14:10:36 +0300 Subject: [PATCH 3/3] Auto populate vars in App format --- docs/shipping/Other/opentelemetry.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/shipping/Other/opentelemetry.md b/docs/shipping/Other/opentelemetry.md index bbd8e1f3..db01ddd1 100644 --- a/docs/shipping/Other/opentelemetry.md +++ b/docs/shipping/Other/opentelemetry.md @@ -221,7 +221,7 @@ Example configuration file: ### Optional: Configure Span Metrics Collection Span metrics collection is disabled by default. To enable it, add & modify the following sections in the `config.yaml` OpenTelemetry configuration. -Replace `${LISTENER_URL}` with the Logz.io metrics listener URL and `${SPM_TOKEN}` with your Logz.io SPM metrics account token. +Replace `<>` with the envrionment for filteration in App360, `<>` with the Logz.io metrics listener URL and `<>` with your Logz.io SPM metrics account token. ```yaml connectors: spanmetrics: @@ -234,7 +234,7 @@ Replace `${LISTENER_URL}` with the Logz.io metrics listener URL and `${SPM_TOKEN - name: cloud.region - name: db.system - name: messaging.system - - default: ${ENV_ID} + - default: <> name: env_id dimensions_cache_size: 100000 histogram: @@ -290,9 +290,9 @@ Replace `${LISTENER_URL}` with the Logz.io metrics listener URL and `${SPM_TOKEN new_label: operation exporters: prometheusremotewrite/spm-logzio: - endpoint: ${LISTENER_URL} + endpoint: https://<>:8053 headers: - Authorization: Bearer ${SPM_TOKEN} + Authorization: Bearer <> # Metrics account token for span metrics user-agent: "logzio-opentelemetry-apm" timeout: 30s add_metric_suffixes: false