Hi Team , I'm Trying to integrate Signoz with Django Application
gunicorn.config.py
import os
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
def post_fork(server, worker):
server.log.info("Worker spawned (pid: %s)", worker.pid)
resource = Resource.create(attributes={
"
service.name": "kyc-rinku"
})
trace.set_tracer_provider(TracerProvider(resource=resource))
span_processor = BatchSpanProcessor(
OTLPSpanExporter(endpoint="
http://x.x:4317")
)
trace.get_tracer_provider().add_span_processor(span_processor)
CMD
OTEL_RESOURCE_ATTRIBUTES=service.name=kyc-rinku OTEL_EXPORTER_OTLP_ENDPOINT=
http://xx:4317 OTEL_EXPORTER_OTLP_PROTOCOL=grpc OTEL_LOGS_EXPORTER=console,otlp OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true opentelemetry-instrument gunicorn b2b.wsgi -c
gunicorn.config.py --workers 2 --threads 2 --reload --bind
0.0.0.0:8000
By this i am able to send Traces metics but in logs i am getting this message
Overriding of current TracerProvider is not allowed
Overriding of current TracerProvider is not allowed
Overriding of current EventLoggerProvider is not allowed