Repository navigation
Conversation
Implements the OpenTelemetry reference application specification [1] with both uninstrumented and instrumented versions of a FastAPI dice-rolling service. The instrumented version uses declarative (file-based) YAML configuration for the telemetry pipeline with OTLP HTTP and console exporters for all three signal types (traces, metrics, logs). [1] https://opentelemetry.io/docs/getting-started/reference-application-specification/ Assisted-by: Claude Opus 4.6
Add OS resource detector, OTEL_LOG_LEVEL diagnostic verbosity control, dynamic OTEL_SERVICE_NAME support via env var substitution, and a CI workflow that smoke-tests both the instrumented and uninstrumented variants of the rolldice application. Co-Authored-By: Claude Opus 4.6 (1M context)
Update all license headers to the SPDX two-line format, fix import sorting and formatting per ruff, and add a towncrier changelog fragment.
|
@MikeGoldsmith , could you take a look at this when you get a chance? |
|
Thank you for this @reggied ! Have we considered putting it in docs/examples instead? https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples |
Hi @tammy-baylis-swi ! I'm new to this repo, so the current location was a best guess. I didn't put it in |
Nice, welcome 👋 I suggest |
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
In response reviewer feedback, move theI roll dice reference app to the docs/examples.
|
@tammy-baylis-swi , I've moved the reference app as you suggested, please take a look when you can. Thanks! |
emdneto
left a comment
There was a problem hiding this comment.
Thanks for working on this. ✌🏻 Left some comments/suggestions
| version = "0.1.0" | ||
| description = "OpenTelemetry reference application — rolldice (FastAPI)" | ||
| license = "Apache-2.0" | ||
| requires-python = ">=3.12" |
There was a problem hiding this comment.
Let's try to stick with the supported baseline version, which is 3.10.
There was a problem hiding this comment.
I suggest we follow the same approach as other tests and implement the logic in Python code and run it through tox, so anyone can run it locally without relying on the CI feedback. You can take a look at docker-tests
There was a problem hiding this comment.
Can we use configure_sdk from sdk._configuration module?
|
|
||
| .. code-block:: bash | ||
|
|
||
| uvicorn app.main:app --host 0.0.0.0 --port 8080 |
There was a problem hiding this comment.
I would say we can mention in advance that an OTLP backend needs to be running otherwise, the user will see a lot of failures in the logs. I know we have this instruction later in this guide, but it would be nice to "enforce" the user to have a collector running before executing this command.
|
|
||
| .. code-block:: bash | ||
|
|
||
| cd instrumentation/opentelemetry-instrumentation-fastapi/examples/rolldice |
| sampler: | ||
| parent_based: | ||
| root: | ||
| always_on: |
There was a problem hiding this comment.
| always_on: | |
| always_on: {} |
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "instrumentation/opentelemetry-instrumentation-fastapi/examples/rolldice/**" |
lzchen
left a comment
There was a problem hiding this comment.
LGTM. I think it might be worth it to wait until configure_sdk is available so we can just simply remove all the duplicate code.
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
|
This PR has been closed due to inactivity. Please reopen if you would like to continue working on it. |
Description
Implements the OpenTelemetry reference application specification [1] with both uninstrumented and instrumented versions of a FastAPI dice-rolling service. The instrumented version uses declarative (file-based) YAML configuration for the telemetry pipeline with OTLP HTTP and console exporters for all three signal types (traces, metrics, logs).
[1] https://opentelemetry.io/docs/getting-started/reference-application-specification/
Fixes # #5167
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Contrib Repo Change?
Checklist: