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

OTLPSpanExporter headers argument is tightly coupled to specific types #3209

Closed
PeterJCLaw-mns opened this issue Mar 2, 2023 · 2 comments · Fixed by #3226
Closed

OTLPSpanExporter headers argument is tightly coupled to specific types #3209

PeterJCLaw-mns opened this issue Mar 2, 2023 · 2 comments · Fixed by #3226
Assignees
Labels
bug Something isn't working good first issue Good first issue help wanted

Comments

@PeterJCLaw-mns
Copy link

Describe your environment

Python 3.11, opentelemetry-exporter-otlp-proto-grpc 1.16.0

Steps to reproduce

According to the type annotations, the following code should work:

from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter

OTLPSpanExporter(headers=[
    ('api-key': 'blah'),
])

however it results in:

TypeError: can only concatenate list (not "tuple") to list

Additionally the type signature for OTLPSpanExporter does not appear to allow passing e.g: a mapping of key value pairs to the headers, however that is in fact supported by the OTLPExporterMixin which handles the passed value.

@PeterJCLaw-mns PeterJCLaw-mns added the bug Something isn't working label Mar 2, 2023
@srikanthccv
Copy link
Member

  • Update the {span,metric,log} exporter types to match the mixin type
  • Fix concatenate issue here

@sreejitkar
Copy link
Contributor

Hi , I am interested in picking up this issue. This is going to be my first contribution towards OTEL so please bear with me if this takes some time. Thanks !

sreejitkar added a commit to sreejitkar/opentelemetry-python that referenced this issue Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good first issue help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants