Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telemetry] use existed env variable instead of introducing new one #1251

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

louie-tsai
Copy link
Collaborator

@louie-tsai louie-tsai commented Feb 1, 2025

Description

Remove new environment variable and use existed one to disable/enable telemetry feature
PR#1168

Issues

NA

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)
  • Others (enhancement, documentation, validation, etc.)

Dependencies

no

Tests

manually testing

@louie-tsai louie-tsai force-pushed the otlp_disable_by_default branch 3 times, most recently from 21c2ef9 to 222244b Compare February 4, 2025 00:12
@louie-tsai louie-tsai force-pushed the otlp_disable_by_default branch from 222244b to c6165d6 Compare February 4, 2025 00:20
Copy link
Contributor

@eero-t eero-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, matches env var used in telemetry code:

GenAIComps/comps$ git grep TELEMETRY | grep py:
__init__.py:if os.getenv("ENABLE_OPEA_TELEMETRY", "false").lower() == "true":
cores/telemetry/opea_telemetry.py:telemetry_endpoint = os.environ.get("TELEMETRY_ENDPOINT", "http://localhost:4318/v1/traces")

Copy link
Collaborator

@lianhao lianhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of enabling/disabling the tracing in comps/init.py, could we do this in the module comps.cores.telemetry.opea_telemetry.opea_telemetry itself.

Doing a simple grep, I found other places just directly import the opea_telemetry.

$ grep -r 'import opea_telemetry' `find -name "*.py"`
./comps/__init__.py:    from comps.cores.telemetry.opea_telemetry import opea_telemetry
./comps/rerankings/src/opea_reranking_microservice.py:from comps.cores.telemetry.opea_telemetry import opea_telemetry
./comps/embeddings/src/opea_embedding_microservice.py:from comps.cores.telemetry.opea_telemetry import opea_telemetry
./comps/cores/mega/orchestrator.py:from ..telemetry.opea_telemetry import opea_telemetry, tracer
./comps/llms/src/text-generation/opea_llm_microservice.py:from comps.cores.telemetry.opea_telemetry import opea_telemetry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants