-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[chore] Support connector in metrics.go.tmpl NewMetricsBuilder #12403
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
[chore] Support connector in metrics.go.tmpl NewMetricsBuilder #12403
Conversation
c7f4818 to
bb83847
Compare
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (90.62%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #12403 +/- ##
==========================================
- Coverage 92.09% 92.06% -0.03%
==========================================
Files 473 477 +4
Lines 25590 26070 +480
==========================================
+ Hits 23567 24002 +435
- Misses 1612 1651 +39
- Partials 411 417 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bb83847 to
4355c04
Compare
|
@Dainerx what other component do you have that emits metrics? |
|
@bogdandrutu in my use case, processors and connectors do emit metrics. My main concern is the if statement surrounding only the function signature. Also, I expected adding a new class in the metadata schema. |
That should be fixed.
How come? I can see why connectors may do it, but how come the processors? |
Processors can have mutate data capabilities, the metrics generation processor does generate metrics. Although, this is possible, I agree with you it's not a best practice to use a processor to generate metrics. I am fine with only supporting
WDYT? |
4355c04 to
9dded0f
Compare
|
I am ok with this proposal. |
0a0f205 to
7d5fcd2
Compare
bogdandrutu
left a comment
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 am not sure what changed, but this looks very strange that every line is updated.
31d7313 to
54a8c7c
Compare
d410125 to
4207422
Compare
| description: Attribute with a map value. | ||
| type: map | ||
|
|
||
| metrics: |
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.
Why is this added to a connector? The metrics section is supposed to be set on scraping receivers only
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 missed the discussion above... Do you have a connector emitting metrics open sourced? It's not in contrib, right?
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 missed the discussion above... Do you have a connector emitting metrics open sourced? It's not in contrib, right?
Right
cmd/mdatagen/metadata-schema.yaml
Outdated
| status: | ||
| # Required: The class of the component (For example receiver) | ||
| class: <receiver|processor|exporter|connector|extension|cmd|pkg|scraper|converter|provider> | ||
| class: <receiver|processor|exporter|connector|extension|scraper|cmd|pkg> |
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.
Revert changes here
4207422 to
380f3b1
Compare
|
|
26d7c6d to
acdde27
Compare
acdde27 to
c496a2f
Compare
da2b89b to
c391970
Compare
c391970 to
af176e3
Compare
|
Pinging for review @dmitryax @sincejune @bogdandrutu |
af176e3 to
9330180
Compare
9330180 to
062c7ef
Compare
4f9fc6b
Description
I discovered this issue while trying to upgrade the opentelemetry collector from v0.111.0 to v0.119.0 that was released two weeks ago. To reproduce please take a look at the issue below.
Link to tracking issue
Fixes #12402
Testing
Run
make generateon a processor or connector component