Skip to content

Add entites for Agent - GW setup #6311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/otelcol/config/collector/agent_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ exporters:
# Entities (applicable only if discovery mode is enabled)
otlphttp/entities:
logs_endpoint: "${SPLUNK_INGEST_URL}/v3/event"
# Use instead when sending to gateway
# endpoint: http://${SPLUNK_GATEWAY_URL}:4318
headers:
"X-SF-Token": "${SPLUNK_ACCESS_TOKEN}"
auth:
Expand Down
25 changes: 24 additions & 1 deletion cmd/otelcol/config/collector/gateway_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,22 @@ exporters:
token: "${SPLUNK_ACCESS_TOKEN}"
endpoint: "${SPLUNK_INGEST_URL}/v1/log"
log_data_enabled: false
# To send entities (applicable only if discovery mode is enabled)
otlphttp/entities:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is only relevant when discovery is enabled, is there some way to tie this to discovery mode? (The pipeline is only enabled when discovery mode is enabled?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is on the GW side and discovery might not be enabled there but enabled at the sender

logs_endpoint: "${SPLUNK_INGEST_URL}/v3/event"
headers:
"X-SF-Token": "${SPLUNK_ACCESS_TOKEN}"
auth:
authenticator: headers_setter

connectors:
# Routing connector to separate entity events from regular logs
routing/logs:
default_pipelines: [logs]
table:
- context: log
condition: instrumentation_scope.attributes["otel.entity.event_as_log"] == true
pipelines: [logs/entities]

service:
extensions: [headers_setter, health_check, http_forwarder, zpages]
Expand All @@ -166,6 +182,13 @@ service:
processors: [memory_limiter, batch]
exporters: [signalfx]
logs:
receivers: [otlp]
receivers: [routing/logs]
processors: [memory_limiter, batch]
exporters: [splunk_hec, splunk_hec/profiling]
logs/entities:
receivers: [routing/logs]
processors: [memory_limiter, batch]
exporters: [otlphttp/entities]
logs/split:
receivers: [otlp]
exporters: [routing/logs]
2 changes: 2 additions & 0 deletions cmd/otelcol/config/collector/upstream_agent_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ exporters:
# Entities (applicable only if discovery mode is enabled)
otlphttp/entities:
logs_endpoint: "${SPLUNK_INGEST_URL}/v3/event"
# Use instead when sending to gateway
# endpoint: http://${SPLUNK_GATEWAY_URL}:4318
headers:
"X-SF-Token": "${SPLUNK_ACCESS_TOKEN}"
auth:
Expand Down
2 changes: 2 additions & 0 deletions cmd/otelcol/fips/config/agent_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ exporters:
# Entities (applicable only if discovery mode is enabled)
otlphttp/entities:
logs_endpoint: "${SPLUNK_INGEST_URL}/v3/event"
# Use instead when sending to gateway
# endpoint: http://${SPLUNK_GATEWAY_URL}:4318
headers:
"X-SF-Token": "${SPLUNK_ACCESS_TOKEN}"
auth:
Expand Down
32 changes: 31 additions & 1 deletion tests/general/default_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ func TestDefaultGatewayConfig(t *testing.T) {
"token": "<redacted>",
"log_data_enabled": false,
},
"otlphttp/entities": map[string]any{
"logs_endpoint": "https://ingest.not.real.signalfx.com/v3/event",
"headers": map[string]any{
"X-SF-Token": "<redacted>",
},
"auth": map[string]any{
"authenticator": "<redacted>",
},
},
},
"extensions": map[string]any{
"headers_setter": map[string]any{
Expand Down Expand Up @@ -195,19 +204,40 @@ func TestDefaultGatewayConfig(t *testing.T) {
"endpoint": fmt.Sprintf("%s:9411", ip),
},
},
"connectors": map[string]any{
"routing/logs": map[string]any{
"default_pipelines": []any{"logs"},
"table": []any{
map[string]any{
"context": "log",
"condition": "instrumentation_scope.attributes[\"otel.entity.event_as_log\"] == true",
"pipelines": []any{"logs/entities"},
},
},
},
},
"service": map[string]any{
"extensions": []any{"headers_setter", "health_check", "http_forwarder", "zpages"},
"pipelines": map[string]any{
"logs": map[string]any{
"exporters": []any{"splunk_hec", "splunk_hec/profiling"},
"processors": []any{"memory_limiter", "batch"},
"receivers": []any{"otlp"},
"receivers": []any{"routing/logs"},
},
"logs/signalfx": map[string]any{
"exporters": []any{"signalfx"},
"processors": []any{"memory_limiter", "batch"},
"receivers": []any{"signalfx"},
},
"logs/entities": map[string]any{
"exporters": []any{"otlphttp/entities"},
"processors": []any{"memory_limiter", "batch"},
"receivers": []any{"routing/logs"},
},
"logs/split": map[string]any{
"receivers": []any{"otlp"},
"exporters": []any{"routing/logs"},
},
"metrics": map[string]any{
"exporters": []any{"signalfx"},
"processors": []any{"memory_limiter", "batch"},
Expand Down
Loading