open-telemetry / opentelemetry-lambda

Create your own Lambda Layer in each OTel language using this starter code. Add the Lambda Layer to your Lamdba Function to get tracing with OpenTelemetry.
https://opentelemetry.io
Apache License 2.0
256 stars 156 forks source link

Unknown type `awsxray` for exporter #1367

Open egalev opened 2 weeks ago

egalev commented 2 weeks ago

Describe the bug Trying to use awsxray exporter as in the example here fails with:

* error decoding 'exporters': unknown type: "awsxray" for id: "awsxray" (valid values: [logging otlp otlphttp prometheusremotewrite])

Steps to reproduce Use the latest collector layer and example config as described in the Lambda Collector Config page

What did you expect to see? Traces exported to X-Ray

What did you see instead? An error during Lambda initialization:

{
    "level": "warn",
    "ts": 1717977940.105163,
    "logger": "lifecycle.manager",
    "msg": "Failed to start the extension",
    "error": "failed to get config: cannot unmarshal the configuration: 1 error(s) decoding:\n\n* error decoding 'exporters': unknown type: \"awsxray\" for id: \"awsxray\" (valid values: [logging otlp otlphttp prometheusremotewrite])"
}

What version of collector/language SDK version did you use? layer-collector/0.7.0 opentelemetry-collector v0.101.0 opentelemetry-collector-contrib v0.101.0

What language layer did you use? Python layer 0.7.0

Additional context The example config also doesn't work unless you change debug to logging. It says that's required prior to v0.86.0 and this theoretically should be v0.101.0. Am I missing something trivial here?

tylerbenson commented 2 weeks ago

So you're trying to export from the collector to xray?

CC @rapphil

egalev commented 2 weeks ago

So you're trying to export from the collector to xray?

CC @rapphil

Exactly, simply tried the example config that includes exporting to xray (after changing debug to logging)

mzl-md commented 2 weeks ago

I think this is a duplicate of https://github.com/open-telemetry/opentelemetry-lambda/issues/99

gshpychka commented 2 weeks ago

I think this is a duplicate of #99

Probably not, since awsxray is included in the official guide linked in the issue

tylerbenson commented 2 weeks ago

As far as I can tell, the xray exporter isn't included in our collector layer build. Perhaps those docs were originally written for the AWS distro layer. @rapphil WDYT?

gshpychka commented 2 weeks ago

As far as I can tell, the xray exporter isn't included in our collector layer build. Perhaps those docs were originally written for the AWS distro layer. @rapphil WDYT?

When I try to use it, I get the message that the collector failed to start with a 403 error, not a helpful error message like in this issue. Why could that be? I'm using Nodejs, though

egalev commented 1 week ago

As far as I can tell, the xray exporter isn't included in our collector layer build. Perhaps those docs were originally written for the AWS distro layer. @rapphil WDYT?

When I try to use it, I get the message that the collector failed to start with a 403 error, not a helpful error message like in this issue. Why could that be? I'm using Nodejs, though

The error message was not consistent for me either, some Lambda initialization attempts resulted in a 403 error like yours, and others with the error message I quoted here. I assumed there's some race condition and that the failure to recognize an awsxray exporter was the root cause, but I didn't dive deeper into it.

egalev commented 1 week ago

As far as I can tell, the xray exporter isn't included in our collector layer build. Perhaps those docs were originally written for the AWS distro layer. @rapphil WDYT?

Is it not included for licensing/FOSS purity reasons, or is there some issue with the exporter? Is there another build that includes everything in opentelemetry-collector-contrib or should we build our own if we want it? Looks like AWS Distro layer also doesn't include everything, any idea why?

tylerbenson commented 1 week ago

I wasn't involved in the project back then, but I think the collector contrib artifact is quite large and I assume there's desire to keep the layer small to reduce cold start delays and size limits.