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

change the Accept header sent to the exporters #41

Merged
merged 3 commits into from
Jan 12, 2023
Merged

change the Accept header sent to the exporters #41

merged 3 commits into from
Jan 12, 2023

Conversation

romain-dartigues
Copy link
Contributor

@romain-dartigues romain-dartigues commented Dec 15, 2022

change the Accept header sent to the exporters

Create a new version of the API endpoint (/v2) and deprecate /v1.
This new version change the Accept HTTP header sent to the exporters requested (from application/openmetrics-text … to text/plain) because the Go library we use does not seems to support all OpenMetrics specificities ^1.

The requests sent to the exporters contains a new HTTP header X-Promfetcher-API-version with the Promfetchers API version.

^1: Java actuator does respect the OpenMetrics specifications; the double quotes in the comments is not supported for example:

# HELP process_cpu_usage The \"recent cpu usage\" for the Java Virtual Machine process

See also:
[1]: prometheus/client_golang#829 (comment)
[2]: prometheus/common#214

Create a new version of the API endpoint (`/v2`).
This new version change the `Accept` HTTP header sent to the exporters requested
(from `application/openmetrics-text` … to `text/plain`) because the Go library
we use does not seems to support all OpenMetrics specificities ^1.

The requests sent to the exporters contains a new HTTP header `X-Promfetcher-API-version` with the Promfetchers API version.

^1: Java actuator does respect the OpenMetrics specifications; the double quotes in the comments is not supported for example:
> # HELP process_cpu_usage The \"recent cpu usage\" for the Java Virtual Machine process

See also:
[1]: prometheus/client_golang#829 (comment)
[2]: prometheus/common#214
  - v1: `application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1`
  - v2: `text/plain; version=0.0.4; charset=utf-8`
@gmllt gmllt merged commit bbc8a4d into master Jan 12, 2023
@romain-dartigues romain-dartigues deleted the rda branch March 17, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants