Skip to content

Allow registerOTel to either return created resource or pass custom resource #153

@kzuraw

Description

@kzuraw

Problem

I recently was working on implementing custom OTEL metrics in our Next.js app (using app router) and I needed to create MeterProvider from @opentelemetry/sdk-metrics. Problem with that provider is it requires @opentelemetry/resources Resource to be defined. As a quick fix I recreated resource from scratch.

Solution

Instead of recreating OTEL resource @vercel/otel can either return created resource that I could pass into MeterProvider or allow me to provide my own resource so both MeterProvider & registerOTel will use the same object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions