Skip to content

refactor(layers/prometheus): rewrite prometheus layer based on observe mod#5069

Merged
Xuanwo merged 8 commits intoapache:mainfrom
koushiro-contrib:rewrite-prometheus-layer
Aug 29, 2024
Merged

refactor(layers/prometheus): rewrite prometheus layer based on observe mod#5069
Xuanwo merged 8 commits intoapache:mainfrom
koushiro-contrib:rewrite-prometheus-layer

Conversation

@koushiro
Copy link
Copy Markdown
Member

Which issue does this PR close?

related PR: #5064

Rationale for this change

What changes are included in this PR?

rewrite PrometheusLayer based on observe mod

Are there any user-facing changes?

API breaking change

@koushiro koushiro requested a review from Xuanwo as a code owner August 29, 2024 10:15
@github-actions github-actions Bot added the releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor" label Aug 29, 2024
Copy link
Copy Markdown
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this! PrometheusClientLayer doesn't have the same feature set, we can add them in following PRs.

Comment thread core/src/layers/prometheus.rs
Comment thread core/src/layers/prometheus.rs
Comment thread core/src/layers/prometheus.rs Outdated
Comment thread core/src/layers/prometheus.rs Outdated
Comment thread core/src/layers/prometheus.rs Outdated
Comment thread core/src/layers/prometheus.rs Outdated
Comment thread core/src/layers/prometheus.rs Outdated
Err(err)
}
if error {
names.push(observe::LABEL_ERROR);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the order significant? Should we place path before error?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The order of path and error is not important, what is important is that the order of label names and label values ​​should correspond, otherwise there will be problems

self.stats.increment_errors_total(self.op, err.kind());
Err(err)
}
if path_label_level > 0 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's put path before error?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done, how about now

Comment thread core/src/layers/prometheus.rs
Copy link
Copy Markdown
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thanks!

@Xuanwo Xuanwo merged commit 3b50fdb into apache:main Aug 29, 2024
@koushiro koushiro deleted the rewrite-prometheus-layer branch August 29, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants