Skip to content

Support JSON marshalling interface #11816

Closed
@jaronoff97

Description

@jaronoff97

Proposal

Right now, Prometheus only supports marshaling via YAML through the following interfaces:

  • yaml.Unmarshaler
  • yaml.Marshaler

This causes an issue for a user trying to serialize a scrape config to JSON as we try to do in the OpenTelemetry world here. Right now we have to serialize to YAML first, and then serialize that to JSON. Would it be welcome to add methods to prometheus scrape config fields (and their sub-fields) to adhere to the following interface

  • json.Marshaler
  • json.Unmarshaler

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