Skip to content

Docs for installing and using the observability tools #92

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/config/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1483,4 +1483,5 @@ SignalR
MatchedOrders
binlog
PollingApproach
EventStreamingApproach
EventStreamingApproach
TraceQL
1 change: 0 additions & 1 deletion docs/content/how-to-guides/operations/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ type: "docs"
title: "Manage Drasi"
linkTitle: "Manage Drasi"
weight: 70
toc_hide: true
description: >
Learn how to manage a Drasi environment
---
50 changes: 22 additions & 28 deletions docs/content/how-to-guides/operations/observability/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,41 @@ description: >
Configuring platform observability
---

The `--observability-level` flag in [drasi init](/reference/command-line-interface/#drasi-init) simplifies setting up various types of observability infrastructure in a Drasi environment. This page describes the different components that can be installed using this flag and explains how to use them.

## Setup metrics
## Observability Level: None
No observability infrastructure will be deployed if `--observability-level` is set to `none`. This is the default value for this flag.

Custom metrics are collected by [Prometheus](https://prometheus.io/), to enable this, install Prometheus into your Kubernetes cluster. By default, the operator will configure Prometheus to scrape metrics from the OpenTelemetry collector.
To publish custom metrics, use the [Prometheus client library](https://prometheus.io/docs/instrumenting/clientlibs/), and push them to `http://otel-collector:4317`
You can deploy observability tools using `kubectl`. The Drasi system sends metrics and traces to `http://otel-collector:4317`, assuming the OpenTelemetry Collector pod is in the same Kubernetes namespace as Drasi and is exposed through a Kubernetes Service named `otel-collector`.

- JavaScript - https://github.com/siimon/prom-client
- C# - https://github.com/prometheus-net/prometheus-net
## Observability Level: Tracing

### Install Prometheus
When `--observability-level` is set to `tracing`, [Grafana Tempo](https://github.com/organizations/drasi-project/settings/actions/runners), a [Grafana Dashboard](https://grafana.com/grafana/dashboards/) and the OpenTelemetry Collector are deployed to the namespace where you installed Drasi.

```
kubectl create namespace dapr-monitoring
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install dapr-prom prometheus-community/prometheus -n dapr-monitoring
```

To explore the metrics, forward a port to the Prometheus server to your local machine.
To explore the traces, forward a port to the Grafana dashboard to your local machine using the command:

```
kubectl port-forward services/dapr-prom-prometheus-server 82:80 -n dapr-monitoring
```bash
kubectl port-forward svc/grafana -n drasi-system 3000:3000
```

In your browser, go to http://localhost:82 and you will see the Prometheus UI.
In your browser, navigate to `http://localhost:3000` to use the Grafana UI. To login to the dashboard, use `drasi` as both the username and the password.

## Setup tracing
Navigate to the `Explore` tab in the left sidebar and select `Tempo` in the main screen. You can now execute TraceQL queries against Tempo to retrieve the traces for Drasi. You can also utilize the `Search` tab to navigate and build your query.

Traces are sent by the Dapr sidecar to Zipkin. To enable this, install Zipkin in your Kubernetes cluster.
## Observability Level: Metrics

### Install Zipkin
When `--observability-level` is set to `metrics`, [Prometheus](https://prometheus.io/), a [Grafana Dashboard](https://grafana.com/grafana/dashboards/) and the OpenTelemetry Collector are deployed to the namespace where you installed Drasi.

```
kubectl create deployment zipkin --image openzipkin/zipkin
kubectl expose deployment zipkin --type ClusterIP --port 9411
To explore the metrics, forward a port to the Grafana dashboard to your local machine using the command:

```bash
kubectl port-forward svc/grafana -n drasi-system 3000:3000
```

To explore the traces, forward a port to the Zipkin server to your local machine.
In your browser, navigate to `http://localhost:3000` to use the Grafana UI. To login to the dashboard, use `drasi` as both the username and the password.

```
kubectl port-forward svc/zipkin 9411:9411
```
Navigate to the `Explore` tab in the left sidebar and select `Prometheus` in the main screen. You can now execute queries against Prometheus using the query builder.

## Observability Level: Full

In your browser, go to http://localhost:9411 and you will see the Zipkin UI.
When `--observability-level` is set to `metrics`, [Grafana Tempo](https://github.com/organizations/drasi-project/settings/actions/runners), [Prometheus](https://prometheus.io/), a [Grafana Dashboard](https://grafana.com/grafana/dashboards/) and the OpenTelemetry Collector are deployed to the namespace where you installed Drasi. Refer to the sections above for details on using each component.
7 changes: 6 additions & 1 deletion docs/content/reference/command-line-interface/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: >

The Drasi Command Line Interface (CLI) is a tool designed to streamline the installation of Drasi and the management of Drasi environments. This section provides comprehensive instructions on how to use the CLI to apply, delete, describe, and manage resources within your Drasi environment. Whether you are installing Drasi for the first time or managing existing resources, the CLI commands and flags detailed here will help you perform these tasks efficiently and effectively.

> The Drasi CLI is a convenient command line interface that wraps the [Drasi Management API](/reference/management-api/). Anything you can do through the Drasi CLI you can do programmatically through the Management API.
> The Drasi CLI is a convenient command line interface that wraps the [Drasi Management API](/reference/management-api/). Anything you can do through the **Drasi** CLI you can do programmatically through the Management API.

## Drasi Resources
In Drasi, a `resource` is a user-definable component that is created and managed using the Drasi CLI. There are currently six types of resource:
Expand Down Expand Up @@ -298,6 +298,11 @@ In the above example, the `inactive-people` resource is currently in an error st
- `--local` (optional): If set, the Drasi CLI will use locally available images to install Drasi instead of pulling them from a remote container registry.
- `-n|--namespace <namespace>` (optional): Specifies the Kubernetes namespace to install Drasi into. This namespace will be created if it does not exist. The default value is "drasi-system".
- `--registry <registry>` (optional): Address of the container registry to pull Drasi images from. The default value is "ghcr.io".
- `--observability-level` (optional): Specifies the observability infrastructure to install. For more information on using observability infrastructure in Drasi, see [observability](/how-to-guides/operations/observability/). There are currently four options for this flag:
- `none` (**Default value**): No observability infrastructure will be deployed.
- `tracing`: Deploys Tempo, Grafana, and OpenTelemetry Collector.
- `metrics`: Deploys Prometheus, Grafana, and OpenTelemetry Collector.
- `full`: Deploys Tempo, Prometheus, Grafana, and OpenTelemetry Collector.
- `--version <tag>` (optional): Container image version tag to use when pulling Drasi images. The default value is the version tag from the Drasi CLI, which is available through the [drasi version](#drasi-version) command discussed below.
- `-h|--help`: Display help for the `init` command.

Expand Down