SigV4 Authentication Support for OTLP HTTP Logs Exporter #184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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=otlp
required or do not set env variableOTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobuf
required or do not set env variableOTEL_METRICS_EXPORTER=none
This feature currently supports only 2 logging libraries by auto-instrumentation,
Bunyan
andWinston
: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_ENDPOINT
is configured to match this url pattern:https://logs.[AWS-REGION].amazonaws.com/v1/logs
Testing:
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: