Skip to content

Conversation

@SungJin1212
Copy link
Member

This PR adds a source label to Distributor to distinguish between Prometheus Remote Write v1 and v2 traffic. As we start adopting PRW v2, observability into the traffic per protocol version becomes necessary.

he following metrics now have a new source label with values rw1, rw2, or rule:

  • cortex_distributor_samples_in_total
  • cortex_distributor_exemplars_in_total
  • cortex_distributor_metadata_in_total
  • cortex_distributor_received_samples_total
  • cortex_distributor_received_exemplars_total
  • cortex_distributor_received_metadata_total

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@dosubot dosubot bot added component/distributor type/observability To help know what is going on inside Cortex labels Jan 30, 2026
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
enum SourceEnum {
API = 0;
RULE = 1;
API_V2 = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

For me I think API v2 is not another source. It should be still API source

Name: "distributor_received_samples_total",
Help: "The total number of received samples, excluding rejected and deduped samples.",
}, []string{"user", "type"}),
}, []string{"user", "type", "source"}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I don't really have a usecase to keep track of received samples or other data types per source.

Is it sufficient to keep track of number of remote write v2 vs v1 requests?

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds right, just counting requests enough for now.

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

Labels

component/distributor size/L type/observability To help know what is going on inside Cortex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants