Skip to content

Commit

Permalink
Fix telemetry endpoint (opea-project#66)
Browse files Browse the repository at this point in the history
* fix telemetry endpoint

Signed-off-by: Spycsh <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Spycsh <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Spycsh and pre-commit-ci[bot] authored May 17, 2024
1 parent 5d56d7f commit 16a16eb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions comps/cores/telemetry/opea_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


import inspect
import os
from functools import wraps

from opentelemetry import trace
Expand All @@ -23,12 +24,12 @@
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter

telemetry_endpoint = os.environ.get("TELEMETRY_ENDPOINT", "http://localhost:4318/v1/traces")

resource = Resource.create({SERVICE_NAME: "opea"})
traceProvider = TracerProvider(resource=resource)

traceProvider.add_span_processor(
BatchSpanProcessor(HTTPSpanExporter(endpoint="http://10.165.57.68:4318/v1/traces")) # change to ip
)
traceProvider.add_span_processor(BatchSpanProcessor(HTTPSpanExporter(endpoint=telemetry_endpoint)))
in_memory_exporter = InMemorySpanExporter()
traceProvider.add_span_processor(BatchSpanProcessor(in_memory_exporter))
trace.set_tracer_provider(traceProvider)
Expand Down

0 comments on commit 16a16eb

Please sign in to comment.