-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
base: main
Are you sure you want to change the base?
Conversation
c7f4818
to
bb83847
Compare
Codecov ReportAttention: Patch coverage is
❌ Your patch check 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.00% 91.97% -0.03%
==========================================
Files 469 473 +4
Lines 25355 25835 +480
==========================================
+ Hits 23327 23762 +435
- Misses 1619 1658 +39
- Partials 409 415 +6 ☔ View full report in Codecov by Sentry. |
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
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
@@ -13,15 +13,15 @@ generated_package_name: string | |||
# Required for components (Optional for subcomponents): A high-level view of the development status and use of this component | |||
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
@@ -293,7 +290,7 @@ func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption) { | |||
rm.SetSchemaUrl(conventions.SchemaURL) | |||
{{- end }} | |||
ils := rm.ScopeMetrics().AppendEmpty() | |||
ils.Scope().SetName(ScopeName) |
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 whit change?
@@ -13,7 +13,7 @@ generated_package_name: string | |||
# Required for components (Optional for subcomponents): A high-level view of the development status and use of this component | |||
status: | |||
# Required: The class of the component (For example receiver) | |||
class: <receiver|processor|exporter|connector|extension|cmd|pkg|scraper|converter|provider> |
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 this change?
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 generate
on a processor or connector component