Skip to content

Commit

Permalink
Add Opentelemetry configurations steps for Span Metrics Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
ralongit committed Oct 15, 2024
1 parent 134af72 commit a6040f3
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions docs/shipping/Other/opentelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a6040f3

Please sign in to comment.