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 encoding #1525

Open
wants to merge 27 commits into
base: dev
Choose a base branch
from
Open

Prometheus encoding #1525

wants to merge 27 commits into from

Conversation

chris124567
Copy link
Member

@chris124567 chris124567 commented Sep 12, 2024

Continuation of #1068

Addressed some of the concerns in the reviews:

  • Move PrometheusMetric method to original type where possible
  • Move writeResponse logic to api package
  • Improve handling slices of Prometheus marshallable types
  • Disable type checking in jape

@chris124567 chris124567 marked this pull request as ready for review September 18, 2024 15:23
@ChrisSchinnerl ChrisSchinnerl modified the milestones: v1.2.0, v2.1.0, v2.0.0 Sep 19, 2024
api/prometheus.go Outdated Show resolved Hide resolved
api/prometheus.go Show resolved Hide resolved
api/prometheus.go Outdated Show resolved Hide resolved
api/prometheus.go Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this might already be broken due to the API refactor going on in the api-breakers branch.
I'd rebase this PR on that branch to make sure it's using the latest return types and endpoints.

internal/prometheus/encoder.go Outdated Show resolved Hide resolved
internal/prometheus/encoder.go Outdated Show resolved Hide resolved
internal/prometheus/encoder.go Outdated Show resolved Hide resolved
internal/prometheus/encoder.go Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add an integration test to /internal/test/e2e/prometheus.go which fetches all those metrics and makes sure they are sane. Which just means fetching all the metrics from various endpoints, checking that the name matches our expectations, the labels exist, the value is set to a value that's not 0 and the timestamp is set to something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you want to handle client end of these requests for the test? Should I just do it in ad hoc way and make an HTTP request helper or should there be a Jape client for the Prometheus endpoints?

api/prometheus.go Outdated Show resolved Hide resolved
api/prometheus.go Outdated Show resolved Hide resolved
api/prometheus.go Outdated Show resolved Hide resolved
api/prometheus.go Outdated Show resolved Hide resolved
api/utils.go Outdated Show resolved Hide resolved
api/utils.go Outdated Show resolved Hide resolved
api/utils.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants