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

Prometheus exporter: Add text-based tests #2338

Open
dashpole opened this issue Sep 27, 2023 · 1 comment
Open

Prometheus exporter: Add text-based tests #2338

dashpole opened this issue Sep 27, 2023 · 1 comment
Labels
Stale triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@dashpole
Copy link
Contributor

dashpole commented Sep 27, 2023

Improve testing of the Prometheus exporter by comparing the serialized output with expectations.

In opentelemetry-go, tests are compared with the contents of a test file, such as https://github.com/open-telemetry/opentelemetry-go/blob/main/exporters/prometheus/testdata/gauge.txt

This makes it easy for anyone familiar with prometheus to determine if the test is producing the expected output, and clearly highlights any breaking changes to the final text format produced by the exporter. This is possible because prometheus does not include timestamps on metrics, making it possible to match the serialized output exactly on test runs.

I believe this could be accomplished by invoking Serialize on the produced metric families.

@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 27, 2023
@lalitb lalitb added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 6, 2023
Copy link

github-actions bot commented Dec 6, 2023

This issue was marked as stale due to lack of activity.

@github-actions github-actions bot added the Stale label Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

2 participants