Skip to content
Merged
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
18 changes: 16 additions & 2 deletions collector/config.combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ processors:
action: delete
- key: process.tags
action: delete

# Console output during an invocation arrives over OTLP from the Logz.io hooks, with trace and span IDs.
# Drop the Telemetry API copy of those lines so they are not sent twice, and Lambda's per-invocation
# START and END lines. Platform records and output written outside an invocation (init, crashes) are kept.
filter/invocation-output:
error_mode: ignore
logs:
log_record:
# Runtime line format: "<timestamp>\t<request id>\t<LEVEL>\t<message>"; init lines carry "undefined".
- 'attributes["type"] == "function" and IsMatch(body, "^\\S+\\t[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\t")'
- 'attributes["type"] == "platform.start" or attributes["type"] == "platform.runtimeDone"'

exporters:
logzio/logs:
account_token: "${env:LOGZIO_LOGS_TOKEN}"
Expand Down Expand Up @@ -60,9 +70,13 @@ service:
processors: [batch]
exporters: [prometheusremotewrite]
logs:
receivers: [telemetryapireceiver]
receivers: [otlp]
processors: [batch]
exporters: [logzio/logs]
logs/telemetryapi:
receivers: [telemetryapireceiver]
processors: [filter/invocation-output, batch]
exporters: [logzio/logs]
telemetry:
logs:
level: "info"
6 changes: 5 additions & 1 deletion collector/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ import (
func TestShippedConfigsAreValid(t *testing.T) {
t.Setenv("LOGZIO_GATEWAY_ENDPOINT", "https://gateway.example.com")
t.Setenv("LOGZIO_GATEWAY_TOKEN", "test-token")
t.Setenv("LOGZIO_TRACES_TOKEN", "test-token")
t.Setenv("LOGZIO_LOGS_TOKEN", "test-token")
t.Setenv("LOGZIO_METRICS_TOKEN", "test-token")
t.Setenv("LOGZIO_REGION", "us")

factories, err := lambdacomponents.Components("collector")
require.NoError(t, err)

for _, file := range []string{"config.gateway.yaml", "config.gateway-traces.yaml"} {
for _, file := range []string{"config.combined.yaml", "config.gateway.yaml", "config.gateway-traces.yaml"} {
t.Run(file, func(t *testing.T) {
provider, err := otelcol.NewConfigProvider(otelcol.ConfigProviderSettings{
ResolverSettings: confmap.ResolverSettings{
Expand Down
Loading