Skip to content

Commit

Permalink
chore(telemetry): fix namespace on otel metrics (#11506)
Browse files Browse the repository at this point in the history
The namespace for otel metrics should be "tracers" and not "tracer". 

This regression was caught by system tests:
DataDog/system-tests#3497. No additional tests
are required.

## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met 
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
  • Loading branch information
mabdinur authored Nov 22, 2024
1 parent 4efe1d4 commit fff9f6c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ddtrace/settings/_otel_remapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __class_getitem__(self, item):
from ..constants import VERSION_KEY
from ..internal.logger import get_logger
from ..internal.telemetry import telemetry_writer
from ..internal.telemetry.constants import TELEMETRY_NAMESPACE_TAG_TRACER


log = get_logger(__name__)
Expand Down Expand Up @@ -168,7 +169,10 @@ def otel_remapping():
if otel_env.startswith("OTEL_") and otel_env != "OTEL_PYTHON_CONTEXT":
log.warning("OpenTelemetry configuration %s is not supported by Datadog.", otel_env)
telemetry_writer.add_count_metric(
"tracer", "otel.env.unsupported", 1, (("config_opentelemetry", otel_env.lower()),)
TELEMETRY_NAMESPACE_TAG_TRACER,
"otel.env.unsupported",
1,
(("config_opentelemetry", otel_env.lower()),),
)
continue

Expand All @@ -181,7 +185,7 @@ def otel_remapping():
otel_value,
)
telemetry_writer.add_count_metric(
"tracer",
TELEMETRY_NAMESPACE_TAG_TRACER,
"otel.env.hiding",
1,
(("config_opentelemetry", otel_env.lower()), ("config_datadog", dd_env.lower())),
Expand All @@ -201,7 +205,7 @@ def otel_remapping():
otel_value,
)
telemetry_writer.add_count_metric(
"tracer",
TELEMETRY_NAMESPACE_TAG_TRACER,
"otel.env.invalid",
1,
(("config_opentelemetry", otel_env.lower()), ("config_datadog", dd_env.lower())),
Expand Down

0 comments on commit fff9f6c

Please sign in to comment.