-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Propogate name and transport for prometheus receiver and exporter #2680
Propogate name and transport for prometheus receiver and exporter #2680
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2680 +/- ##
=======================================
Coverage 91.73% 91.73%
=======================================
Files 290 290
Lines 15614 15615 +1
=======================================
+ Hits 14324 14325 +1
Misses 892 892
Partials 398 398
Continue to review full report at Codecov.
|
@yeya24 thanks a lot, while reviewing this PR, I realize that our interface is error prone and went ahead and create #2682 which will remove the problems.
I hope that PR solves your issue as well as improves usability. Can you check if that solves your issue? |
@bogdandrutu Thanks. Looks like your pr is a better way to solve that. The original interface is a little bit confusing.
Oops. I didn't even notice it returns a ctx. |
@yeya24 I think we need to re-open this PR, since my PR only fixes the exporter and not the receiver part. |
Can you remove the exporter fix and leave only the receiver part? |
Hi, I am happy to do that. Is the current receiver change okay or do I need to change anything? One thing I am not very sure about is that I created a |
fdee413
to
a4ed41f
Compare
@bogdandrutu Hello, can you please take a look at this pr? Anything else I need to do to fix the failing test? |
To fix the test just rerun that test |
Signed-off-by: yeya24 <yb532204897@gmail.com>
a4ed41f
to
aed5e10
Compare
@bogdandrutu Can you please take another review? |
@@ -73,7 +76,8 @@ func (r *pReceiver) Start(ctx context.Context, host component.Host) error { | |||
if !r.cfg.UseStartTimeMetric { | |||
jobsMap = internal.NewJobsMap(2 * time.Minute) | |||
} | |||
ocaStore := internal.NewOcaStore(ctx, r.consumer, r.logger, jobsMap, r.cfg.UseStartTimeMetric, r.cfg.StartTimeMetricRegex, r.cfg.Name()) | |||
receiverCtx := obsreport.ReceiverContext(ctx, r.cfg.Name(), transport) |
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.
This needs to start from context.Background()
because the context from Start should not be stored and used later (not you bug, but please fix that as well).
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.
Sorry, I was going to update this but it was merged. Do you need me to open another pr?
…y#2680) Bumps [boto3](https://github.com/boto/boto3) from 1.26.84 to 1.26.89. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](boto/boto3@1.26.84...1.26.89) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: yeya24 yb532204897@gmail.com
Description:
Fix the issue #2533 which the prometheus
receiver
andexporter
names are not correctly propagated via the context.Link to tracking Issue: #2533
Testing: < Describe what testing was performed and which tests were added.>
Only tested manually with the config below:
The metrics I can get from
localhost:8888/metrics
areDocumentation: < Describe the documentation added.>
Please delete paragraphs that you did not use before submitting.