Skip to content

TS issues setting the Registry to OpenMetrics #653

Description

@bahamut657

I'm trying to configure prom-client to work with the global default Registry set to OpenMetrics format.

As described in the README this requires:

// set the content type to OpenMetrics format
import client from 'prom-client';

client.register.setContentType(
  client.Registry.OPENMETRICS_CONTENT_TYPE
);

Using this code, TS throws the following error:

Argument of type '"application/openmetrics-text; version=1.0.0; charset=utf-8"' is not assignable to parameter of type '"text/plain; version=0.0.4; charset=utf-8"'

I'm able to workaround it only type-casting it to any but it really seems an issue in the TS interface

Affected version: 15.1.3
NodeJS version 20.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions