Skip to content

Commit

Permalink
Merge branch 'main' into sapm_to_otlphttp
Browse files Browse the repository at this point in the history
  • Loading branch information
asreehari-splunk authored Dec 14, 2024
2 parents 7c519f0 + 2a3be15 commit d47f800
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

- (Splunk) Change default traces exporter to otlphttp exporter. ([#5588](https://github.com/signalfx/splunk-otel-collector/pull/5588)).

### 🚀 New components 🚀

- (Splunk) Add `filestats` receiver ([](https://github.com/signalfx/splunk-otel-collector/pull/5229))


### 💡 Enhancements 💡

- (Splunk) Automatic Discovery:
Expand Down
9 changes: 8 additions & 1 deletion cmd/otelcol/config/collector/agent_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ processors:
#value: staging/production/...
#key: deployment.environment

# The following processor is used to add "otelcol.service.mode" attribute to the internal metrics
resource/add_mode:
attributes:
- action: insert
value: "agent"
key: otelcol.service.mode

exporters:
# Traces
otlphttp:
Expand Down Expand Up @@ -187,7 +194,7 @@ service:
#exporters: [otlp/gateway]
metrics/internal:
receivers: [prometheus/internal]
processors: [memory_limiter, batch, resourcedetection]
processors: [memory_limiter, batch, resourcedetection, resource/add_mode]
# When sending to gateway, at least one metrics pipeline needs
# to use signalfx exporter so host metadata gets emitted
exporters: [signalfx]
Expand Down
9 changes: 8 additions & 1 deletion cmd/otelcol/config/collector/gateway_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ processors:
#value: staging/production/...
#key: deployment.environment

# The following processor is used to add "otelcol.service.mode" attribute to the internal metrics
resource/add_mode:
attributes:
- action: insert
value: "gateway"
key: otelcol.service.mode

# Detect if the collector is running on a cloud system. Overrides resource attributes set by receivers.
# Detector order is important: the `system` detector goes last so it can't preclude cloud detectors from setting host/os info.
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#ordering
Expand Down Expand Up @@ -143,7 +150,7 @@ service:
exporters: [signalfx]
metrics/internal:
receivers: [prometheus/internal]
processors: [memory_limiter, batch, resourcedetection/internal]
processors: [memory_limiter, batch, resourcedetection/internal, resource/add_mode]
exporters: [signalfx/internal]
logs/signalfx:
receivers: [signalfx]
Expand Down
1 change: 1 addition & 0 deletions docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The distribution offers support for the following components.
| [discovery](../internal/receiver/discoveryreceiver) | [in development] |
| [elasticsearch](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/elasticsearchreceiver) | [beta] |
| [filelog](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/filelogreceiver) | [beta] |
| [filestats](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/filestatsreceiver) | [beta] |
| [fluentforward](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/fluentforwardreceiver) | [beta] |
| [googlecloudpubsub](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/googlecloudpubsubreceiver) | [beta] |
| [haproxy](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/haproxyreceiver) | [beta] |
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver v0.114.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchreceiver v0.114.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver v0.114.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudpubsubreceiver v0.114.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver v0.114.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,8 @@ github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearch
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchreceiver v0.114.0/go.mod h1:Z/bI5LI+rHrB83nF95ob6coRNLeE3KJGvqZS9dbEiAA=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0 h1:Ivu3DRhbERboPxMJeyJpmretbKDJ3hsOAGBQXt2yY3U=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0/go.mod h1:UrMGrA8bA1VeYhdiam7/Xu/U4joG6JftMULEVWLDbe0=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver v0.114.0 h1:hnQdqS5q5ERor3bhJDcWvXLhln7RZ+iFTbPVBiDDfYo=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver v0.114.0/go.mod h1:G1J0WELUlVxmyRvwfvkLcVBXoiXx0442FP0V1T2mTiU=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0 h1:Yx0RUwviLdYyozkuqbfpEhSH+ehXlKsW5TtlZbiKm4Q=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0/go.mod h1:Bh9h5hYTgr/zQgXUnvihkLvN1IMmVY/OFa8aHc3gMJU=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudpubsubreceiver v0.114.0 h1:J+zseMbZpKcz5MuHGXR91QbmBV+pO4GCy7OwXvarQT4=
Expand Down
2 changes: 2 additions & 0 deletions internal/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudpubsubreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver"
Expand Down Expand Up @@ -177,6 +178,7 @@ func Get() (otelcol.Factories, error) {
discoveryreceiver.NewFactory(),
elasticsearchreceiver.NewFactory(),
filelogreceiver.NewFactory(),
filestatsreceiver.NewFactory(),
fluentforwardreceiver.NewFactory(),
googlecloudpubsubreceiver.NewFactory(),
haproxyreceiver.NewFactory(),
Expand Down
1 change: 1 addition & 0 deletions internal/components/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func TestDefaultComponents(t *testing.T) {
"discovery",
"elasticsearch",
"filelog",
"filestats",
"fluentforward",
"googlecloudpubsub",
"haproxy",
Expand Down
22 changes: 20 additions & 2 deletions tests/general/default_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ func TestDefaultGatewayConfig(t *testing.T) {
"detectors": []any{"gcp", "ecs", "ec2", "azure", "system"},
"override": true,
},
"resource/add_mode": map[string]any{
"attributes": []any{
map[string]any{
"action": "insert",
"value": "gateway",
"key": "otelcol.service.mode",
},
},
},
},
"receivers": map[string]any{
"jaeger": map[string]any{
Expand Down Expand Up @@ -195,7 +204,7 @@ func TestDefaultGatewayConfig(t *testing.T) {
},
"metrics/internal": map[string]any{
"exporters": []any{"signalfx/internal"},
"processors": []any{"memory_limiter", "batch", "resourcedetection/internal"},
"processors": []any{"memory_limiter", "batch", "resourcedetection/internal", "resource/add_mode"},
"receivers": []any{"prometheus/internal"},
},
"traces": map[string]any{
Expand Down Expand Up @@ -314,6 +323,15 @@ func TestDefaultAgentConfig(t *testing.T) {
"detectors": []any{"gcp", "ecs", "ec2", "azure", "system"},
"override": true,
},
"resource/add_mode": map[string]any{
"attributes": []any{
map[string]any{
"action": "insert",
"value": "agent",
"key": "otelcol.service.mode",
},
},
},
},
"receivers": map[string]any{
"fluentforward": map[string]any{"endpoint": fmt.Sprintf("%s:8006", ip)},
Expand Down Expand Up @@ -401,7 +419,7 @@ func TestDefaultAgentConfig(t *testing.T) {
},
"metrics/internal": map[string]any{
"exporters": []any{"signalfx"},
"processors": []any{"memory_limiter", "batch", "resourcedetection"},
"processors": []any{"memory_limiter", "batch", "resourcedetection", "resource/add_mode"},
"receivers": []any{"prometheus/internal"},
},
"traces": map[string]any{
Expand Down

0 comments on commit d47f800

Please sign in to comment.