Skip to content

Commit

Permalink
[otel-integration] add status_code dimension to spanmetrics preset (#411
Browse files Browse the repository at this point in the history
) (#414)
  • Loading branch information
povilasv authored Jun 4, 2024
1 parent 3ae88a4 commit 83743c4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
3 changes: 3 additions & 0 deletions otel-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## OpenTelemtry-Integration

### v0.0.76 / 2024-06-03
- [FEAT] Add Kubernetes metadata to otel collector metrics

### v0.0.75 / 2024-06-03
- [FEAT] Add status_code to spanmetrics preset

Expand Down
2 changes: 1 addition & 1 deletion 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.75
version: 0.0.76
keywords:
- OpenTelemetry Collector
- OpenTelemetry Agent
Expand Down
5 changes: 5 additions & 0 deletions otel-integration/k8s-helm/e2e-test/expected_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ var expectedResourceAttributesPrometheusreceiver = map[string]string{
"k8s.node.name": "otel-integration-agent-e2e-control-plane",
"host.name": "otel-integration-agent-e2e-control-plane",
"host.id": "",
"k8s.pod.ip": "",
"k8s.pod.name": "",
"k8s.deployment.name": "",
"k8s.namespace.name": "",
"k8s.daemonset.name": "",
"os.type": "linux",
}

Expand Down
2 changes: 1 addition & 1 deletion otel-integration/k8s-helm/e2e-test/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func checkResourceAttributes(t *testing.T, attributes pcommon.Map, scopeName str

attributes.Range(func(k string, v pcommon.Value) bool {
val, ok := compareMap[k]
require.True(t, ok, "unexpected attribute %v", k)
require.True(t, ok, "unexpected attribute %v - scopeName: %s", k, scopeName)
if val != "" {
require.Equal(t, val, v.AsString(), "unexpected value for attribute %v", k)
}
Expand Down
16 changes: 15 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.75"
version: "0.0.76"

extensions:
kubernetesDashboard:
Expand Down Expand Up @@ -206,6 +206,12 @@ opentelemetry-agent:
detectors: ["gcp", "ec2"]
timeout: 2s
override: true
transform/prometheus:
error_mode: ignore
metric_statements:
- context: resource
statements:
- set(attributes["k8s.pod.ip"], attributes["net.host.name"]) where attributes["service.name"] == "opentelemetry-collector"
k8sattributes:
filter:
node_from_env_var: KUBE_NODE_NAME
Expand Down Expand Up @@ -270,6 +276,7 @@ opentelemetry-agent:
exporters:
- coralogix
processors:
- transform/prometheus
- k8sattributes
- resourcedetection/env
- resourcedetection/region
Expand Down Expand Up @@ -444,6 +451,12 @@ opentelemetry-cluster-collector:
- "k8s.job.name"
- "k8s.pod.name"
- "k8s.node.name"
transform/prometheus:
error_mode: ignore
metric_statements:
- context: resource
statements:
- set(attributes["k8s.pod.ip"], attributes["net.host.name"]) where attributes["service.name"] == "opentelemetry-infrastructure-collector"
resource/kube-events:
attributes:
- key: service.name
Expand Down Expand Up @@ -581,6 +594,7 @@ opentelemetry-cluster-collector:
exporters:
- coralogix
processors:
- transform/prometheus
- k8sattributes
- metricstransform/k8s-dashboard
- transform/k8s-dashboard
Expand Down

0 comments on commit 83743c4

Please sign in to comment.