Skip to content

Commit

Permalink
Use constant for service name
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcollins committed Dec 5, 2024
1 parent 34cd124 commit b9200dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/ott_spec.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from ott_lib import project_path, trace_loop

SERVICE_NAME = "spec-svc"

if __name__ == "__main__":
trace_loop(1)

Expand All @@ -11,7 +13,7 @@ def requirements(self):
def environment_variables(self):
return {
"OTEL_PYTHON_DISABLED_INSTRUMENTATIONS": "system_metrics",
"OTEL_SERVICE_NAME": "spec-svc",
"OTEL_SERVICE_NAME": SERVICE_NAME,
}

def wrapper_command(self):
Expand Down Expand Up @@ -41,7 +43,7 @@ def on_stop(self, telemetry, stdout: str, stderr: str, returncode: int) -> None:

assert get_attribute(attributes, "process.pid")

assert get_attribute(attributes, "service.name").value.string_value == "spec-svc"
assert get_attribute(attributes, "service.name").value.string_value == SERVICE_NAME

def is_http(self):
return False

0 comments on commit b9200dc

Please sign in to comment.