Skip to content

Commit

Permalink
added handling for warning
Browse files Browse the repository at this point in the history
Signed-off-by: Kshitiz Vijayvargiya <[email protected]>
  • Loading branch information
kshitiz-okahu committed Jul 9, 2024
1 parent 0309457 commit 179a84f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/monocle_apptrace/instrumentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,18 @@ def setup_monocle_telemetry(
SERVICE_NAME: workflow_name
})
traceProvider = TracerProvider(resource=resource)
tracerProviderDefault = trace.get_tracer_provider()
providerType = type(tracerProviderDefault).__name__
for processor in span_processors:
processor.on_start = on_processor_start
tracerProviderDefault.add_span_processor(processor)
traceProvider.add_span_processor(processor)
trace.set_tracer_provider(traceProvider)
if "Proxy" in providerType :
trace.set_tracer_provider(traceProvider)
instrumentor = MonocleInstrumentor(user_wrapper_methods=wrapper_methods)
instrumentor.app_name = workflow_name
instrumentor.instrument()
if not instrumentor.is_instrumented_by_opentelemetry:
instrumentor.instrument()


def on_processor_start(span: Span, parent_context):
Expand Down

0 comments on commit 179a84f

Please sign in to comment.