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

Infer resource type based on conventions for export to Google Cloud Monitoring (Stackdriver) #581

Closed
wants to merge 2 commits into from
Closed

Infer resource type based on conventions for export to Google Cloud Monitoring (Stackdriver) #581

wants to merge 2 commits into from

Conversation

nilebox
Copy link
Member

@nilebox nilebox commented Jul 30, 2020

Description:
Reverse mapping from OpenTelemetry's semantic conventions to OpenCensus resource type.

Since OpenTelemetry has switched to using semantic conventions over explicit resource types, the resource type may now be missing when converted to OpenCensus resource.
In that case we will try to infer the resource type based on documented conventions.

Link to tracking Issue:
The issue has been originally discussed in open-telemetry/opentelemetry-python#951 (comment), pointing to inconsistency between OpenCensus and OpenTelemetry which needs to be addressed.

Testing: Unit tests added for new functionality

Documentation: No documentation needed, we may just refer to the already documented semantic conventions.

/cc @james-bebbington @aabmass

@nilebox nilebox requested a review from a team July 30, 2020 05:44
@nilebox
Copy link
Member Author

nilebox commented Jul 30, 2020

Actually, this feature seems generic and may be useful for other exporters relying on backward compatibility with OpenCensus.
Would it make sense to move it to the core repo (https://github.com/open-telemetry/opentelemetry-collector/blob/master/translator/internaldata/resource_to_oc.go) ?

@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #581 into master will decrease coverage by 0.02%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #581      +/-   ##
==========================================
- Coverage   86.21%   86.19%   -0.03%     
==========================================
  Files         195      196       +1     
  Lines       10608    10618      +10     
==========================================
+ Hits         9146     9152       +6     
- Misses       1129     1132       +3     
- Partials      333      334       +1     
Flag Coverage Δ
#integration 71.09% <ø> (ø)
#unit 86.02% <60.00%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
exporter/stackdriverexporter/resource_mapper.go 86.95% <0.00%> (-13.05%) ⬇️
...porter/stackdriverexporter/resource_type_mapper.go 85.71% <85.71%> (ø)

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 be70db2...907ccd5. Read the comment docs.

@james-bebbington
Copy link
Member

Agree that open-telemetry/opentelemetry-collector#1462 is preferred solution if approved

@nilebox
Copy link
Member Author

nilebox commented Jul 30, 2020

Will close this PR for now, and will re-open if the core PR gets rejected.

@nilebox nilebox closed this Jul 30, 2020
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
Beta README.md
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.

2 participants