Skip to content

Commit

Permalink
respect OTEL_SERVICE_NAME when set
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
  • Loading branch information
Lawouach committed Aug 2, 2023
1 parent 71cd486 commit 270ee6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

[Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-opentracing/compare/0.11.0...HEAD

### Changed

- Respect `OTEL_SERVICE_NAME` when set

## [0.11.0][] - 2023-08-02

[0.11.0]: https://github.com/chaostoolkit-incubator/chaostoolkit-opentracing/compare/0.10.0...0.11.0
Expand Down
4 changes: 3 additions & 1 deletion chaostracing/oltp.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,9 @@ def activity_completed(self, activity: Activity, state: Run) -> None:
# Private functions
###############################################################################
def configure_traces(configuration: Configuration) -> None:
resource = Resource.create({"service.name": "chaostoolkit"})
resource = Resource.create(
{"service.name": os.getenv("OTEL_SERVICE_NAME", "chaostoolkit")}
)

vendor = configuration.get("otel_vendor", os.getenv("OTEL_VENDOR"))
if vendor == "gcp":
Expand Down

0 comments on commit 270ee6a

Please sign in to comment.