Skip to content

Commit

Permalink
Merge pull request #303 from vvydier/main
Browse files Browse the repository at this point in the history
updated the README to add instructions on how to set the service.name when using the OTLP Exporter
  • Loading branch information
Ignacio Bonafonte authored May 26, 2022
2 parents 03d5cd3 + 0030030 commit fe831f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Examples/OTLP Exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ The prometheus client will be available at <http://localhost:9090>.
Note: It may take some time for the application metrics to appear on the Prometheus dashboard.
![Screenshot of the running example](images/prometheus-metrics.png)

5. If you don't set service.name as per https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md the default name of the service and spans generate by the OTLP Exporter is `unknown_service:otlpexporter` You can either set the service.name by editing the schema in Xcode and the set the environment variable for OTEL_RESOURCE_ATTRIBUTES, or set it via command line:
```shell script
# from this directory
OTEL_RESOURCE_ATTRIBUTES="service.name=my-swift-app,service.version=v1.2.3" swift run OTLPExporter
```
This will create a service and spans with the name `my-swift-app`
## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
Expand Down

0 comments on commit fe831f0

Please sign in to comment.