diff --git a/docs/opentelemetry.rst b/docs/opentelemetry.rst index 96781028e3..d006a60461 100644 --- a/docs/opentelemetry.rst +++ b/docs/opentelemetry.rst @@ -4,7 +4,7 @@ Integrating OpenTelemetry What is OpenTelemetry? ---------------------- -`OpenTelemetry `_ is an open-source observability framework for traces, metrics, and logs. +`OpenTelemetry `_ is an open-source observability framework for traces, metrics, and logs. It is a merger of OpenCensus and OpenTracing projects hosted by Cloud Native Computing Foundation. OpenTelemetry allows developers to collect and export telemetry data in a vendor agnostic way. With OpenTelemetry, you can instrument your application once and then add or change vendors without changing the instrumentation, for example, here is a list of `popular DataDog competitors `_ that support OpenTelemetry. @@ -97,7 +97,7 @@ See `OpenTelemetry Python Tracing API `_ that supports distributed tracing, metrics, and logs. You can use it to monitor applications and set up automatic alerts to receive notifications via email, Slack, Telegram, and more. +Uptrace is an `open source APM `_ that supports distributed tracing, metrics, and logs. You can use it to monitor applications and set up automatic alerts to receive notifications via email, Slack, Telegram, and more. You can use Uptrace to monitor redis-py using this `GitHub example `_ as a starting point. @@ -111,9 +111,9 @@ Monitoring Redis Server performance In addition to monitoring redis-py client, you can also monitor Redis Server performance using OpenTelemetry Collector Agent. -OpenTelemetry Collector is a proxy/middleman between your application and a `distributed tracing tool `_ such as Uptrace or Jaeger. Collector receives telemetry data, processes it, and then exports the data to APM tools that can store it permanently. +OpenTelemetry Collector is a proxy/middleman between your application and a `distributed tracing tool `_ such as Uptrace or Jaeger. Collector receives telemetry data, processes it, and then exports the data to APM tools that can store it permanently. -For example, you can use the Redis receiver provided by Otel Collector to `monitor Redis performance `_: +For example, you can use the `OpenTelemetry Redis receiver ` provided by Otel Collector to monitor Redis performance: .. image:: images/opentelemetry/redis-metrics.png :alt: Redis metrics @@ -123,55 +123,50 @@ See introduction to `OpenTelemetry Collector `_ using alerting rules. For example, the following rule uses the group by node expression to create an alert whenever an individual Redis shard is down: +Uptrace also allows you to monitor `OpenTelemetry metrics `_ using alerting rules. For example, the following monitor uses the group by node expression to create an alert whenever an individual Redis shard is down: .. code-block:: python - # /etc/uptrace/uptrace.yml - - alerting: - rules: - - name: Redis shard is down - metrics: - - redis_up as $redis_up - query: - - group by cluster # monitor each cluster, - - group by bdb # each database, - - group by node # and each shard - - $redis_up == 0 - # shard should be down for 5 minutes to trigger an alert - for: 5m + monitors: + - name: Redis shard is down + metrics: + - redis_up as $redis_up + query: + - group by cluster # monitor each cluster, + - group by bdb # each database, + - group by node # and each shard + - $redis_up + min_allowed_value: 1 + # shard should be down for 5 minutes to trigger an alert + for_duration: 5m You can also create queries with more complex expressions. For example, the following rule creates an alert when the keyspace hit rate is lower than 75%: .. code-block:: python - # /etc/uptrace/uptrace.yml - - alerting: - rules: - - name: Redis read hit rate < 75% - metrics: - - redis_keyspace_read_hits as $hits - - redis_keyspace_read_misses as $misses - query: - - group by cluster - - group by bdb - - group by node - - $hits / ($hits + $misses) < 0.75 - for: 5m + monitors: + - name: Redis read hit rate < 75% + metrics: + - redis_keyspace_read_hits as $hits + - redis_keyspace_read_misses as $misses + query: + - group by cluster + - group by bdb + - group by node + - $hits / ($hits + $misses) as hit_rate + min_allowed_value: 0.75 + for_duration: 5m See `Alerting and Notifications `_ for details. What's next? ------------ -Next, you can learn how to configure `uptrace-python `_ to export spans, metrics, and logs to Uptrace. +Next, you can learn how to configure `uptrace-python `_ to export spans, metrics, and logs to Uptrace. You may also be interested in the following guides: -- `OpenTelemetry Django `_ -- `OpenTelemetry Flask `_ -- `OpenTelemetry FastAPI `_ -- `OpenTelemetry SQLAlchemy `_ -- `OpenTelemetry instrumentations `_ +- `OpenTelemetry Django `_ +- `OpenTelemetry Flask `_ +- `OpenTelemetry FastAPI `_ +- `OpenTelemetry SQLAlchemy `_