Skip to content

Opencensus exporters should populate service_name from Span Resource#1897

Merged
lzchen merged 4 commits intoopen-telemetry:mainfrom
lzchen:opencensus
Jun 8, 2021
Merged

Opencensus exporters should populate service_name from Span Resource#1897
lzchen merged 4 commits intoopen-telemetry:mainfrom
lzchen:opencensus

Conversation

@lzchen
Copy link
Copy Markdown
Contributor

@lzchen lzchen commented Jun 7, 2021

Fixes #1714

@lzchen lzchen requested review from a team, owais and srikanthccv and removed request for a team June 7, 2021 18:31
Copy link
Copy Markdown
Member

@srikanthccv srikanthccv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably get rid of this logic in exporter(s) init.

        tracer_provider = trace.get_tracer_provider()
        service_name = (
            tracer_provider.resource.attributes[SERVICE_NAME]
            if getattr(tracer_provider, "resource", None)
            else Resource.create().attributes.get(SERVICE_NAME)
        )

@lzchen lzchen merged commit d26699d into open-telemetry:main Jun 8, 2021
@lzchen lzchen deleted the opencensus branch June 8, 2021 15:43
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.

Opencensus exporters should populate service_name from Span Resource

3 participants