Skip to content

Commit

Permalink
Logging: Defensively access provider resource
Browse files Browse the repository at this point in the history
  • Loading branch information
owais committed Feb 1, 2022
1 parent 2189e81 commit 07dc271
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def instrumentation_dependencies(self) -> Collection[str]:
def _instrument(self, **kwargs):
service_name = ""
provider = kwargs.get("tracer_provider", None) or get_tracer_provider()
resource = provider.resource if provider else None
resource = getattr(provider, "resource", None)
if resource:
service_name = resource.attributes.get("service.name")

Expand Down

0 comments on commit 07dc271

Please sign in to comment.