-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tracing): Add commented out tracing relation into templates #2100
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing to the docs!
I had some nitpick comments that I repeated across all the reference docs.
Also, it's possible that this work will conflict with #2083, so you may want to wait on that PR to merge.
@@ -200,6 +209,11 @@ The RabbitMQ integration creates the connection string in the environment variab | |||
- `RABBITMQ_PORT` | |||
- `RABBITMQ_VHOST` | |||
|
|||
The Tracing integration creates the following environment variables that you may use to configure your application: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps "can" instead of "may"
|
||
12-Factor charms are designed to be easily observable using the [Canonical Observability Stack](https://charmhub.io/topics/canonical-observability-stack). | ||
|
||
You can easily integrate your charm with [Loki](https://charmhub.io/loki-k8s) and [Prometheus](https://charmhub.io/prometheus-k8s) using Juju. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps include grafana
juju integrate django-k8s grafana | ||
juju integrate django-k8s loki | ||
juju integrate django-k8s prometheus | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include an empty line
juju integrate django-k8s prometheus | ||
``` | ||
After integration, you will be able to observe your workload using Grafana dashboards. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's reduce to 1 empty line
To learn how to enable tracing in your Django app you can checkout the example in [Paas Charm repository](https://github.com/canonical/paas-charm). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's refer to the how to for tracing
To learn how to enable tracing in your Django app you can checkout the example in [Paas Charm repository](https://github.com/canonical/paas-charm). | ||
|
||
OpenTelemetry will automatically read the environment variables and configure the OpenTelemetry SDK to use them. | ||
For other frameworks and further configuration options please refer to [OpenTelemetry documentation](https://opentelemetry-python.readthedocs.io/en/latest/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the [OpenTelemetry documentation](https://opentelemetry-python.readthedocs.io/en/latest/) for further information about tracing.
To enable tracing in your Flask app you can simply add the following lines to your workload code: | ||
|
||
```python | ||
from opentelemetry import trace | ||
from opentelemetry.instrumentation.flask import FlaskInstrumentor | ||
|
||
app = Flask(__name__) | ||
FlaskInstrumentor().instrument_app(app) | ||
tracer = trace.get_tracer(__name__) | ||
``` | ||
|
||
You also need to add the following lines into your `requirements.txt` file: | ||
|
||
``` | ||
opentelemetry-api | ||
opentelemetry-exporter-otlp-proto-http | ||
opentelemetry-instrumentation-flask | ||
opentelemetry-sdk | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this in the how to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, instead of a how to, please prepare a blog post I can attach to the regular updates about tracing in Flask. We can include links to the frameworks here for people to read more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do a spread test for flask
Related to Paas Charm PR.
Adds the possibility to integrate with Tempo Operator to trace the 12 Factor app workload for current frameworks(go, django, flask, fastapi).
reviewers:
@jdkandersson
@javierdelapuente