Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info annotations from responses are not exposed #1733

Open
laurynaslubys opened this issue Feb 12, 2025 · 1 comment
Open

Info annotations from responses are not exposed #1733

laurynaslubys opened this issue Feb 12, 2025 · 1 comment

Comments

@laurynaslubys
Copy link

Prometheus somewhat recently added info annotations as a separate field, however this is not exposed via client_golang. Exposing them without changing or expanding the public API seems not possible.

What would be a good approach to take here?

@bwplotka
Copy link
Member

Thanks!

Indeed we have to likely move Warnings to Annotations type like:

// Ref: https://github.com/prometheus/prometheus/pull/14429/files
type Annotations struct{
    Infos []string
    Warnings []string
}

We have a couple of options.

  1. Technically speaking we could break API. API is kind of an experimental version, although it's obviously not very explicit since it's part of the v1 semver module.
  2. We could deprecate the current API and move it (with necessary changes and breakage) to the upcoming exp module, so we can explicitly break an API. While annoying, it would be at least more expected for callers, when they compiler fail to build after the upgrade. Move to another module was motivated here: proposal: Move API code to a separate module/repo #1649
  3. We can do the same but to separate module that could have proper major version bumps. Trickier to maintain ofc (more modules, more releases) I don't know if we have headcount for this.
  4. We played with the idea of deprecating the API and trying to build OpenAPI spec and generate Go code from it somewhere else, won't help with breakages I believe Migrate Prometheus APIs to OpenAPI/Swagger prometheus#2392

I think I would vote for 1 or 2

cc @kakkoyun @ArthurSens @vesari thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants