Skip to content
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions products/clickstack/deployment/managed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ keywords: ['clickstack', 'deployment', 'setup', 'configuration', 'observability'
---

import { Image } from "/snippets/components/Image.jsx";
import BetaBadge from "/snippets/components/BetaBadge/BetaBadge.jsx";

import { TrackedLink } from "/snippets/components/GalaxyTrackedLink/GalaxyTrackedLink.jsx";

Expand All @@ -19,12 +18,6 @@ import SetupManagedIngestion from '/snippets/clickstack/_setup_managed_ingestion
import NavigateClickStackUI from '/snippets/clickstack/_navigate_managed.mdx';
import ProviderSelection from '/snippets/clickstack/_select_provider.mdx';

<BetaBadge/>

::::note[Beta feature]
This feature is in ClickHouse Cloud beta.
::::

This **guide is for existing users of ClickHouse Cloud**. If you're new to ClickHouse Cloud, we recommend our [Getting Started](/products/clickstack/getting-started/managed) guide for Managed ClickStack.

In this deployment pattern, both ClickHouse and the ClickStack UI (HyperDX) are hosted in ClickHouse Cloud, minimizing the number of components the user needs to self-host.
Expand Down
1 change: 1 addition & 0 deletions products/clickstack/example-datasets/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ This section provides various sample datasets and examples to help you get start
| [Local Data](/products/clickstack/example-datasets/local-data) | Collect local system metrics and logs sending them to ClickStack for analysis |
| [Remote Demo Data](/products/clickstack/example-datasets/remote-demo-data) | Connect to our remote demo cluster and explore an issue |
| [Session Replay Demo](/products/clickstack/example-datasets/session-replay) | Instrument a demo web application for session replay and view your interactions in ClickStack |
| [Synthetic data with otelgen](/products/clickstack/example-datasets/otelgen) | Use `otelgen` to send synthetic logs, traces and metrics to a running ClickStack OpenTelemetry collector |
204 changes: 204 additions & 0 deletions products/clickstack/example-datasets/otelgen.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
---
slug: /use-cases/observability/clickstack/getting-started/otelgen
title: 'Generate synthetic OpenTelemetry data with otelgen'
sidebarTitle: 'Synthetic data with otelgen'
description: 'Use otelgen to send synthetic logs, traces and metrics to a ClickStack OpenTelemetry collector'
doc_type: 'guide'
toc_max_heading_level: 2
keywords: ['clickstack', 'otelgen', 'synthetic data', 'OpenTelemetry', 'test', 'logs', 'traces', 'metrics', 'observability']
---

[`otelgen`](https://github.com/krzko/otelgen) is a small Go CLI that generates synthetic OTLP logs, traces and metrics. Use it to confirm that an existing ClickStack OpenTelemetry collector is accepting data and that events surface in the ClickStack UI.

This guide assumes the collector is already running with OTLP endpoints on `4317` (gRPC) and `4318` (HTTP).

<Tabs>
<Tab title="Managed ClickStack">

<Steps>

<Step>
### Prerequisites {#prerequisites-managed}

This guide assumes you have completed the [Getting Started Guide for Managed ClickStack](/products/clickstack/deployment/managed) and have an OpenTelemetry collector running with the OTLP gRPC (`4317`) and HTTP (`4318`) endpoints reachable from the machine you run `otelgen` on. If you [secured the collector](/products/clickstack/ingesting-data/collector#securing-the-collector) with an `OTLP_AUTH_TOKEN`, keep that value handy.
</Step>

<Step>
### Install otelgen {#install-otelgen-managed}

Install with Homebrew:

```shell
brew install krzko/tap/otelgen
```

Or install with Go:

```shell
go install github.com/krzko/otelgen@latest
```
</Step>

<Step>
### Set environment variables {#set-env-vars-managed}

Export the collector endpoint and, if the collector is secured, the auth token:

```shell
export OTEL_ENDPOINT=<host>:4317
export OTLP_AUTH_TOKEN=<your_otlp_auth_token>
```

Use the host and port of your collector. For a collector running on the same machine, this is `localhost:4317`.

<Note>
**Unsecured collector**

The ClickStack OpenTelemetry collector is unauthenticated by default. If you haven't followed [Securing the collector](/products/clickstack/ingesting-data/collector#securing-the-collector) to set an `OTLP_AUTH_TOKEN`, skip `OTLP_AUTH_TOKEN` here and drop the `--header` flag from the commands below.
</Note>
</Step>

<Step>
### Generate traces {#generate-traces-managed}

Send a short burst of multi-span traces:

```shell
otelgen --otel-exporter-otlp-endpoint ${OTEL_ENDPOINT} \
--header "authorization=${OTLP_AUTH_TOKEN}" \
--protocol grpc --insecure \
--rate 2 --duration 10 \
traces multi
```

`--rate` is traces per second and `--duration` is the run length in seconds. `--insecure` disables TLS on the gRPC connection, which is needed when pointing `otelgen` at the collector's plaintext OTLP port.
</Step>

<Step>
### Generate logs {#generate-logs-managed}

```shell
otelgen --otel-exporter-otlp-endpoint ${OTEL_ENDPOINT} \
--header "authorization=${OTLP_AUTH_TOKEN}" \
--protocol grpc --insecure \
--rate 2 --duration 10 \
logs multi
```
</Step>

<Step>
### Generate metrics {#generate-metrics-managed}

The metrics subcommands don't honor `--duration`. Run the command and press `Ctrl+C` after a few seconds to stop it.

```shell
otelgen --otel-exporter-otlp-endpoint ${OTEL_ENDPOINT} \
--header "authorization=${OTLP_AUTH_TOKEN}" \
--protocol grpc --insecure \
--rate 2 \
metrics sum
```

`otelgen` also supports `gauge`, `histogram`, `up-down-counter` and `exponential-histogram` subcommands under `metrics`.
</Step>

<Step>
### Verify in ClickStack {#verify-managed}

Open the ClickStack UI from the ClickHouse Cloud console. In the `Search` view, switch the source between `Logs` and `Traces` to confirm new events. Set the time range to `Last 15 minutes`. Open the `Chart Explorer`, select `Metrics`, and chart one of the metric names produced by `otelgen` (for example `otelgen.metrics.sum`) to verify metrics ingestion.
</Step>

</Steps>

</Tab>
<Tab title="ClickStack Open Source">

<Steps>

<Step>
### Prerequisites {#prerequisites-oss}

This guide assumes you have started Open Source ClickStack using the [instructions for the all-in-one image](/products/clickstack/getting-started/oss), and that the OTLP endpoints (`4317` gRPC and `4318` HTTP) are reachable. You also need the ingestion API key from the HyperDX UI under `Team Settings > API Keys`.
</Step>

<Step>
### Install otelgen {#install-otelgen-oss}

Install with Homebrew:

```shell
brew install krzko/tap/otelgen
```

Or install with Go:

```shell
go install github.com/krzko/otelgen@latest
```
</Step>

<Step>
### Set environment variables {#set-env-vars-oss}

Export the collector endpoint and the ingestion API key:

```shell
export OTEL_ENDPOINT=localhost:4317
export CLICKSTACK_API_KEY=<your_ingestion_api_key>
```
</Step>

<Step>
### Generate traces {#generate-traces-oss}

Send a short burst of multi-span traces:

```shell
otelgen --otel-exporter-otlp-endpoint ${OTEL_ENDPOINT} \
--header "authorization=${CLICKSTACK_API_KEY}" \
--protocol grpc --insecure \
--rate 2 --duration 10 \
traces multi
```

`--rate` is traces per second and `--duration` is the run length in seconds. `--insecure` enables plaintext gRPC against the local collector.
</Step>

<Step>
### Generate logs {#generate-logs-oss}

```shell
otelgen --otel-exporter-otlp-endpoint ${OTEL_ENDPOINT} \
--header "authorization=${CLICKSTACK_API_KEY}" \
--protocol grpc --insecure \
--rate 2 --duration 10 \
logs multi
```
</Step>

<Step>
### Generate metrics {#generate-metrics-oss}

The metrics subcommands don't honor `--duration`. Run the command and press `Ctrl+C` after a few seconds to stop it.

```shell
otelgen --otel-exporter-otlp-endpoint ${OTEL_ENDPOINT} \
--header "authorization=${CLICKSTACK_API_KEY}" \
--protocol grpc --insecure \
--rate 2 \
metrics sum
```

`otelgen` also supports `gauge`, `histogram`, `up-down-counter` and `exponential-histogram` subcommands under `metrics`.
</Step>

<Step>
### Verify in ClickStack {#verify-oss}

Visit [http://localhost:8080](http://localhost:8080) to open the ClickStack UI. In the `Search` view, switch the source between `Logs` and `Traces` to confirm new events. Set the time range to `Last 15 minutes`. Open the `Chart Explorer`, select `Metrics`, and chart one of the metric names produced by `otelgen` (for example `otelgen.metrics.sum`) to verify metrics ingestion.
</Step>

</Steps>

</Tab>
</Tabs>
3 changes: 0 additions & 3 deletions products/clickstack/getting-started/managed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ keywords: ['Managed ClickStack', 'getting started', 'ClickHouse Cloud']

import { Image } from "/snippets/components/Image.jsx";

import BetaBadge from "/snippets/components/BetaBadge/BetaBadge.jsx";
import SetupManagedIngestion from '/snippets/clickstack/_setup_managed_ingestion.mdx';
import ProviderSelection from '/snippets/clickstack/_select_provider.mdx';
import NavigateClickStackUI from '/snippets/clickstack/_navigate_managed.mdx';

<BetaBadge/>

The easiest way to get started is by deploying **Managed ClickStack** on **ClickHouse Cloud**, which provides a fully managed, secure backend while retaining complete control over ingestion, schema, and observability workflows. This removes the need to operate ClickHouse yourself and delivers a range of benefits:

- Automatic scaling of compute, independent of storage
Expand Down
Loading