-
Notifications
You must be signed in to change notification settings - Fork 15
SigV4 Authentication Support for OTLP HTTP Logs Exporter #181
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
Conversation
Can we support Pino as well? We mention it in our docs and is considered top 2 popular logging libraries for Node.js.
|
aws-distro-opentelemetry-node-autoinstrumentation/src/register.ts
Outdated
Show resolved
Hide resolved
...tro-opentelemetry-node-autoinstrumentation/src/exporter/otlp/aws/common/aws-authenticator.ts
Show resolved
Hide resolved
...pentelemetry-node-autoinstrumentation/src/exporter/otlp/aws/traces/otlp-aws-span-exporter.ts
Outdated
Show resolved
Hide resolved
...pentelemetry-node-autoinstrumentation/src/exporter/otlp/aws/traces/otlp-aws-span-exporter.ts
Outdated
Show resolved
Hide resolved
...tro-opentelemetry-node-autoinstrumentation/src/exporter/otlp/aws/common/aws-authenticator.ts
Outdated
Show resolved
Hide resolved
...tro-opentelemetry-node-autoinstrumentation/src/exporter/otlp/aws/common/aws-authenticator.ts
Show resolved
Hide resolved
aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts
Show resolved
Hide resolved
aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts
Outdated
Show resolved
Hide resolved
aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts
Outdated
Show resolved
Hide resolved
Yep should also support Pino as well, I missed that in the description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't looked at the new unit tests yet, will look in a second pass
Issue #, if available:
Supporting ADOT JS auto instrumentation to automatically inject SigV4 authentication headers for outgoing log requests to the allow exporting to the AWS Logs OTLP endpoint. Users will need to configure the following environment variables in order to enable and properly run this exporter:
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://logs.[AWS-REGION].amazonaws.com/v1/logs; requiredOTEL_EXPORTER_OTLP_LOGS_HEADERS=x-aws-log-group=[CW-LOG-GROUP-NAME],x-aws-log-stream=[CW-LOG-STREAM-NAME]requiredOTEL_LOGS_EXPORTER=otlprequired or do not set env variableOTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobufrequired or do not set env variableOTEL_METRICS_EXPORTER=noneThis feature currently supports only 2 logging libraries by auto-instrumentation,
BunyanandWinston:https://docs.honeycomb.io/send-data/logs/opentelemetry/sdk/javascript/
Description of changes:
Add new AwsAuthenticator class used by both OtlpAwsLogExporter and OtlpAwsSpanExporter which extends the upstream OTLPProtoLogExporter to inject Sigv4 headers directly into the headers.
Modified ADOT JS auto instrumentation to automatically detect if a user is exporting to CW Logs OTLP Logs endpoint by checking if the environment variable
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTis configured to match this url pattern:https://logs.[AWS-REGION].amazonaws.com/v1/logsTesting:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Example log in CW Logs: