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

[receiver/prometheusremotewrite] validate if scope is already present #36927

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

perebaj
Copy link
Contributor

@perebaj perebaj commented Dec 23, 2024

Description

Continuing the work done in this PR, addressing a TODO.

Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

Good start! We're only missing a test and don't forget to add datapoints for the case where scopemetrics already exist!

.chloggen/prwreceiver-checkscope.yaml Outdated Show resolved Hide resolved
Comment on lines 247 to 248
scopeExists = true
break
Copy link
Member

Choose a reason for hiding this comment

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

We also want to add datapoints in this case, but for the existing scope

Suggested change
scopeExists = true
break
scopeExists = true
addDatapoints(scope.Metrics.AppendEmpty().SetEmptyGauge().Datapoints(), ls, ts)
break

We're using Metrics.AppendEmpty() due to the first TODO in this function, in a follow up PR we'll cache metric type/unit/name and use that to decide if we append empty metrics or use an already existing one :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think that I need to add this detail in a comment?

Copy link
Member

Choose a reason for hiding this comment

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

Nah, the already existing TODO is enough :)

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

Successfully merging this pull request may close these issues.

2 participants