Skip to content
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

otel.yaml documentation outdated with aws-otel-collector-arm64-ver-0-115-0:2 causing crash #1056

Open
tendervittles opened this issue Jan 18, 2025 · 0 comments

Comments

@tendervittles
Copy link

tendervittles commented Jan 18, 2025

Describe the bug
The documentation for the otel.yaml example file is outdated when using aws-otel-collector-arm64-ver-0-115-0:2.

Steps to reproduce
Run a lambda with the basic config recommended by AWS Observability and aws-otel-collector-arm64-ver-0-115-0:2 in the extension layer.

#collector.yaml in the root directory
#Set an environment variable 'OPENTELEMETRY_COLLECTOR_CONFIG_FILE' to '/var/task/collector.yaml'

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: "localhost:4317"
      http:
        endpoint: "localhost:4318"

exporters:
  logging:
  awsxray:

service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [awsxray]
    metrics:
      receivers: [otlp]
      exporters: [logging]
  telemetry:
    metrics:
      address: localhost:8888
  1. This recommends the now deprecated OPENTELEMETRY_COLLECTOR_CONFIG_FILE. This should be OPENTELEMETRY_COLLECTOR_CONFIG_URI.
  2. The logging export is both deprecated and borks the layer.

This config produces:

{
  "level": "warn",
  "ts": 17737229504.1134509,
  "logger": "NewCollector",
  "msg": "The OPENTELEMETRY_COLLECTOR_CONFIG_FILE environment variable is deprecated. Please use OPENTELEMETRY_COLLECTOR_CONFIG_URI instead."
}

{
    "level": "warn",
    "ts": 1737229504.3452542,
    "logger": "lifecycle.manager",
    "msg": "Failed to start the extension",
    "error": "failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):\n\nerror decoding 'exporters': the logging exporter has been deprecated, use the debug exporter instead"
}

{
    "level": "info",
    "ts": 1737229504.3453238,
    "msg": "done",
    "error": "failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):\n\nerror decoding 'exporters': the logging exporter has been deprecated, use the debug exporter instead; Post \"http://127.0.0.1:9001/2020-01-01/extension/init/error\": net/http: invalid header field value for \"Lambda-Extension-Function-Error-Type\"",
    "errorCauses": [
        {
            "error": "failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):\n\nerror decoding 'exporters': the logging exporter has been deprecated, use the debug exporter instead"
        },
        {
            "error": "Post \"http://127.0.0.1:9001/2020-01-01/extension/init/error\": net/http: invalid header field value for \"Lambda-Extension-Function-Error-Type\""
        }
    ]
}

Ending with:

EXTENSION	Name: collector	State: Registered	Events: [INVOKE, SHUTDOWN]
INIT_REPORT Init Duration: 3687.99 ms	Phase: invoke	Status: error	Error Type: Extension.Crash
START RequestId: e4143d0f-1229-40f8-bbc4-bfd58c871b87 Version: $LATEST
RequestId: e4143d0f-1229-40f8-bbc4-bfd58c871b87 Error: exit code 0
Extension.Crash

My lambda does run after removing the logging export from the otel.yaml.

What did you expect to see?
I expected the AWS Observability otel config file documentation to not cause a crash.

What did you see instead?
The AWS Observability lambda otel config file documentation caused a crash.

What version of collector/language SDK version did you use?
aws-otel-collector-arm64-ver-0-115-0:2

What language layer did you use?
Go, the bad AWS Observability otel config crashes the lambda before my code runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant