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

Botocore instrumentation omits TracerProvider resources #219

Closed
CeeBeeCee opened this issue Sep 28, 2020 · 3 comments
Closed

Botocore instrumentation omits TracerProvider resources #219

CeeBeeCee opened this issue Sep 28, 2020 · 3 comments
Labels

Comments

@CeeBeeCee
Copy link

I'm manually instrumenting Botocore (v0.13b) in my Flask/postgres app as follows with OTLP exporter.

from opentelemetry.instrumentation.botocore import BotocoreInstrumentor labels = { "service.name": "myapp", "version": 1 } resource = Resource(attributes=labels) trace.set_tracer_provider(TracerProvider(resource=resource)) otlp_exporter = OTLPSpanExporter(endpoint=endpoint) span_processor = BatchExportSpanProcessor(otlp_exporter) FlaskInstrumentor().instrument_app(tapp) BotocoreInstrumentor().instrument()

The traces that the Botocore instrumentation is generating is missing the resource attributes(service.name and version). The traces generated by the Flask instrumentation have these resources. Is this a bug or am I missing something?

What is the expected behavior?
Expecting to see service.name and version in the traces.

Botocore trace
InstrumentationLibrary opentelemetry.instrumentation.botocore 0.13b0 Span #0 Trace ID : 1f87a1cc76c38b2e6879a9d9459c8e3e Parent ID : ID : 375e03d19f05e29e Name : s3.command Kind : SPAN_KIND_CONSUMER Start time : 2020-09-28 21:47:25.9426736 +0000 UTC End time : 2020-09-28 21:47:26.004678 +0000 UTC Status code : STATUS_CODE_UNKNOWN_ERROR Status message : NoCredentialsError: Unable to locate credentials Attributes: -> params.Bucket: STRING(data) -> params.Key: STRING(xlsx) -> params.ServerSideEncryption: STRING(aws:kms) -> aws.agent: STRING(botocore) -> aws.operation: STRING(PutObject) -> aws.region: STRING(us-east-1)

Other traces

InstrumentationLibrary postgres 0.13b0 Span open-telemetry/opentelemetry-python#16 Trace ID : 0ef61b3da87cdcc46bd150336fbe7cdb Parent ID : 600800d603896b80 ID : 6181692326794a48 Name : postgres.query Resource labels: -> service.name: STRING(myapp) -> version: STRING(1)

See how this one has service.name while the Boto traces does not. Let me know if you need any other details

@aabmass
Copy link
Member

aabmass commented Sep 30, 2020

I believe the issue here is that the OTLP trace exporter does not attach the TracerProvider's resource. Instead, it is taking resource from individual spans which I believe is an issue (see open-telemetry/opentelemetry-python#1180).

@codeboten codeboten transferred this issue from open-telemetry/opentelemetry-python Nov 26, 2020
@github-actions
Copy link

github-actions bot commented Apr 6, 2021

This issue was marked stale due to lack of activity. It will be closed in 30 days.

@github-actions
Copy link

github-actions bot commented Jun 5, 2021

Closed as inactive. Feel free to reopen if this issue needs resolving.

@github-actions github-actions bot closed this as completed Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants