Skip to content

Bug - Instrumentation doesn't work on Middleware #152

@bozzelliandrea

Description

@bozzelliandrea

In a middleware I'm trying to add a custom metric using

import { metrics } from "@opentelemetry/api";

const httpResponsesCounter = metrics
  .getMeter("test")
  .createCounter<{ status_code: number }>("test");

the opentelemetry configuration seems to be ignored and metrics return a NoopCounterMetric

if I add the same code in an api router it generate a CounterMetric and send signals through the collector

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