Skip to content

Commit

Permalink
Use batch processor in example (#2225)
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv authored and lzchen committed Nov 4, 2021
1 parent c70ee09 commit 0e039c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/examples/logs/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
OTLPHandler,
set_log_emitter_provider,
)
from opentelemetry.sdk.logs.export import SimpleLogProcessor
from opentelemetry.sdk.logs.export import BatchLogProcessor
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import (
BatchSpanProcessor,
ConsoleSpanExporter,
SimpleSpanProcessor,
)

trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(
SimpleSpanProcessor(ConsoleSpanExporter())
BatchSpanProcessor(ConsoleSpanExporter())
)

log_emitter_provider = LogEmitterProvider(
Expand All @@ -31,7 +31,7 @@
set_log_emitter_provider(log_emitter_provider)

exporter = OTLPLogExporter(insecure=True)
log_emitter_provider.add_log_processor(SimpleLogProcessor(exporter))
log_emitter_provider.add_log_processor(BatchLogProcessor(exporter))
log_emitter = log_emitter_provider.get_log_emitter(__name__, "0.1")
handler = OTLPHandler(level=logging.NOTSET, log_emitter=log_emitter)

Expand Down

0 comments on commit 0e039c6

Please sign in to comment.