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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Comment on lines +162 to +163
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Use instead when sending to gateway
# endpoint: http://${SPLUNK_GATEWAY_URL}:4318
# Use instead when sending to gateway
# endpoint: ${SPLUNK_GATEWAY_URL}:4318

Is http:// required here? Same question for other usages. I'm wondering why the value provided isn't consistent with usage of other environment variables.

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?)

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does otel.entity.event_as_log come from? Is there some way we could use a central variable or constant here? Not required as it might be a bit messy, just concerned about the possibility of this changing in the future.

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