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

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

Merged
merged 8 commits into from
Aug 29, 2024

Conversation

koushiro
Copy link
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

Copy link
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.

core/src/layers/prometheus.rs Show resolved Hide resolved
core/src/layers/prometheus.rs Show resolved Hide resolved
core/src/layers/prometheus.rs Outdated Show resolved Hide resolved
core/src/layers/prometheus.rs Outdated Show resolved Hide resolved
core/src/layers/prometheus.rs Outdated Show resolved Hide resolved
core/src/layers/prometheus.rs Outdated Show resolved Hide resolved
Err(err)
}
if error {
names.push(observe::LABEL_ERROR);
Copy link
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
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
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
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

core/src/layers/prometheus.rs Show resolved Hide resolved
Copy link
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
228 of 229 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants