Fix Resource constructor examples to use Resource.create()#4925
Open
rohansood10 wants to merge 3 commits intoopen-telemetry:mainfrom
Open
Fix Resource constructor examples to use Resource.create()#4925rohansood10 wants to merge 3 commits intoopen-telemetry:mainfrom
rohansood10 wants to merge 3 commits intoopen-telemetry:mainfrom
Conversation
Signed-off-by: Rohan Sood <rohansood10@users.noreply.github.com>
e4282fe to
04f41fe
Compare
Signed-off-by: Rohan Sood <rohansood10@users.noreply.github.com>
xrmx
approved these changes
Feb 19, 2026
xrmx
requested changes
Feb 19, 2026
Contributor
xrmx
left a comment
There was a problem hiding this comment.
I think we at least two more entries:
exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/__init__.py: resource = Resource(attributes={
exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/__init__.py: resource = Resource(attributes={
Address review feedback: also update Resource(attributes=...) to Resource.create(...) in otlp-proto-grpc and otlp-proto-http exporter module docstrings.
Author
|
Good catch! Updated both |
tammy-baylis-swi
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4554
Example code in the docs uses
Resource(...)directly instead of the recommendedResource.create(...)factory method. Using the constructor directly skips merging with default resources (like telemetry SDK attributes), giving users incorrect guidance.Changed
Resource(toResource.create(in:docs/examples/opencensus-shim/app.pydocs/exporter/prometheus/prometheus.rst