Skip to content

Commit

Permalink
[otel-integration] add spanMetricsMulti preset
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv committed Mar 26, 2024
1 parent 86b7cd5 commit 5fe9da4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
4 changes: 4 additions & 0 deletions otel-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## OpenTelemtry-Integration

### v0.0.66 / 2024-03-26

- [FEAT] add spanMetricsMulti preset, which allows to specify histogram buckets per application.

### v0.0.65 / 2024-03-19

- [FIX] logsCollection preset make force_flush_period configurable and disable it by default.
Expand Down
10 changes: 5 additions & 5 deletions otel-integration/k8s-helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: otel-integration
description: OpenTelemetry Integration
version: 0.0.65
version: 0.0.66
keywords:
- OpenTelemetry Collector
- OpenTelemetry Agent
Expand All @@ -11,22 +11,22 @@ keywords:
dependencies:
- name: opentelemetry-collector
alias: opentelemetry-agent
version: "0.81.4"
version: "0.81.6"
repository: https://cgx.jfrog.io/artifactory/coralogix-charts-virtual
condition: opentelemetry-agent.enabled
- name: opentelemetry-collector
alias: opentelemetry-agent-windows
version: "0.81.4"
version: "0.81.6"
repository: https://cgx.jfrog.io/artifactory/coralogix-charts-virtual
condition: opentelemetry-agent-windows.enabled
- name: opentelemetry-collector
alias: opentelemetry-cluster-collector
version: "0.81.4"
version: "0.81.6"
repository: https://cgx.jfrog.io/artifactory/coralogix-charts-virtual
condition: opentelemetry-cluster-collector.enabled
- name: opentelemetry-collector
alias: opentelemetry-gateway
version: "0.81.4"
version: "0.81.6"
repository: https://cgx.jfrog.io/artifactory/coralogix-charts-virtual
condition: opentelemetry-gateway.enabled
sources:
Expand Down
18 changes: 18 additions & 0 deletions otel-integration/k8s-helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,24 @@ spanNameReplacePattern:

This will result in your spans having generalized name `user-{id}`.

#### Span metrics with different buckets per application

If you want to use Span Metrics connector with different buckets per application you need to use `spanMetricsMulti` preset. For example:

```yaml
presets:
spanMetricsMulti:
enabled: false
defaultHistogramBuckets: [1ms, 4ms, 10ms, 20ms, 50ms, 100ms, 200ms, 500ms, 1s, 2s, 5s]
configs:
- selector: route() where attributes["service.name"] == "one"
histogramBuckets: [1s, 2s]
- selector: route() where attributes["service.name"] == "two"
histogramBuckets: [5s, 10s]
```

For selector you need to write a [OTTL](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/ottl/README.md) statement, more information is available in [routing connector docs](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/connector/routingconnector).

### Multi-line log configuration

This helm chart supports multi-line configurations for different namespace, pod, and/or container names. The following example configuration applies a specific firstEntryRegex for a container which is part of a x Pod in y namespace:
Expand Down
15 changes: 14 additions & 1 deletion otel-integration/k8s-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ global:
defaultSubsystemName: "integration"
logLevel: "warn"
collectionInterval: "30s"
version: "0.0.65"
version: "0.0.66"

extensions:
kubernetesDashboard:
Expand Down Expand Up @@ -126,6 +126,19 @@ opentelemetry-agent:
- name: http.method
- name: cgx.transaction
- name: cgx.transaction.root
# Configures the collector to export span metrics with different histogram bucket options
# for different applications. Applications are selected and routed to different pipelines
# using OTTL. For more information see https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/connector/routingconnector
# Make sure to not use with spanMetrics preset, which applies single spanmetrics connector to tracing pipeline.
spanMetricsMulti:
enabled: false
collectionInterval: "{{.Values.global.collectionInterval}}"
defaultHistogramBuckets: [1ms, 4ms, 10ms, 20ms, 50ms, 100ms, 200ms, 500ms, 1s, 2s, 5s]
configs: []
# - selector: route() where attributes["service.name"] == "one"
# histogramBuckets: [1s, 2s]
# - selector: route() where attributes["service.name"] == "two"
# histogramBuckets: [5s, 10s]
config:
extensions:
zpages:
Expand Down

0 comments on commit 5fe9da4

Please sign in to comment.