-
Notifications
You must be signed in to change notification settings - Fork 805
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
Allow passing counter metric name to datapoint to show in case of validation error #1121
base: main
Are you sure you want to change the base?
Allow passing counter metric name to datapoint to show in case of validation error #1121
Conversation
@@ -1,19 +1,30 @@ | |||
package io.prometheus.metrics.model.snapshots; | |||
|
|||
public abstract class DataPointSnapshot { | |||
private final String metricName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305/3.0.2 (complile only) and annotate with @Nullable
this(null, value, labels, exemplar, createdTimestampMillis, scrapeTimestampMillis); | ||
} | ||
|
||
public CounterDataPointSnapshot( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think builder is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what you mean here, please elaborate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need an overloaded ctor - you can just use the builder to pass the metric name
@@ -105,12 +116,17 @@ public Builder createdTimestampMillis(long createdTimestampMillis) { | |||
return this; | |||
} | |||
|
|||
public Builder metricName(String metricName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javadoc please
started to refactor in main...pass-metric-name-to-datapoint |
@zeitlinger
WRT #1090