Skip to content

OpenTelemetry Protocol Support #1520

@willfarrell

Description

@willfarrell

We've been long waiting to otlp to become more performant and a signal from AWS about unifying in an approach. With the official deprecation of xray (https://aws.amazon.com/blogs/mt/announcing-aws-x-ray-sdks-daemon-end-of-support-and-opentelemetry-migration/), we can move forward.

Idea

  • @middy/otlp utility packages to create logger, tracer, metrics
    • also init resources (context)
    • support treeshaking (no env support)
  • @middy/otlp-context middleware to inject request context into logs/traces/metrics
  • @middy/otlp-logger middleware to log event, response, error
  • @middy/otlp-metrics middleware to add metric for cold start count and/or error count
    • do people want this?
  • @middy/otlp-tracer middleware to trace before -> after/onError (aka approx duration of handler when last in stack)
    • do people want this?
  • sample plugin for tracing middy, it's middleware, and the handler. this approach is more accurate than a middleware
  • Defaults:
    • resources: env, process, @opentelemetry/resource-detector-aws
    • exporters: stdout, fetch (if needed for logs/traces)
    • instrumentations: none
    • propagators: @opentelemetry/propagator-aws-xray-lambda
  • Docs
    • How to trace, fetch, dns, https, pg, redis

If you have exp in otlp or have a solution you're allowed to share. Please reach out.

Release

  • add to v7.x
  • deprecate duplicate middleware in v8.x
    • input-output-logger
    • error-logger

Refs

cc @lmammino @dreamorosi

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions