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

k8sprocessor: fix setting attributes on metrics passed from agent #836

Conversation

dmitryax
Copy link
Member

Bug description:
When otel-collector running as an agent with k8s processor in passthrough mode sets "k8s.pod.id" resource label to fix metrics source for further enrichment, standalone collector miss that attribute and doesn't enrich metrics as expected.

Testing: Added a test to cover the bug

@dmitryax dmitryax requested review from owais and a team August 27, 2020 07:25
@codecov
Copy link

codecov bot commented Aug 27, 2020

Codecov Report

Merging #836 into master will increase coverage by 16.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #836       +/-   ##
===========================================
+ Coverage   72.00%   88.18%   +16.18%     
===========================================
  Files          14      231      +217     
  Lines         600    12406    +11806     
===========================================
+ Hits          432    10940    +10508     
- Misses        144     1111      +967     
- Partials       24      355      +331     
Flag Coverage Δ
#integration 72.00% <ø> (ø)
#unit 88.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
processor/k8sprocessor/processor.go 96.22% <100.00%> (ø)
...sformprocessor/operation_aggregate_label_values.go 100.00% <0.00%> (ø)
...resourcedetectionprocessor/internal/aws/ec2/ec2.go 90.90% <0.00%> (ø)
exporter/awsxrayexporter/translator/aws.go 96.74% <0.00%> (ø)
receiver/awsxrayreceiver/receiver.go 100.00% <0.00%> (ø)
exporter/carbonexporter/metricdata_to_plaintext.go 86.11% <0.00%> (ø)
exporter/sentryexporter/transport.go 31.57% <0.00%> (ø)
...oudlogserviceexporter/metricsdata_to_logservice.go 100.00% <0.00%> (ø)
receiver/receivercreator/runner.go 53.33% <0.00%> (ø)
exporter/splunkhecexporter/tracedata_to_splunk.go 100.00% <0.00%> (ø)
... and 213 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update afe8750...15be326. Read the comment docs.

Bug description: 
When otel-collector running as an agent with k8s processor in passthrough mode sets "k8s.pod.id" resource label to fix metrics source for further enrichment, standalone collector miss that attribute and doesn't enrich metrics as expected.
@dmitryax dmitryax force-pushed the k8sprocessor-fix-metrics-in-passthrough-mode branch from 0142db4 to 15be326 Compare August 27, 2020 07:47
@bogdandrutu bogdandrutu merged commit 4d0086e into open-telemetry:master Aug 27, 2020
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
While zero IDs are considered by most formats to be an error the Collector should not drop data because of that. This follows the same pattern already adopted for the Jaeger receiver.
ljmsc referenced this pull request in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: evantorrie <evantorrie@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants