Skip to content

Commit

Permalink
Remove references to v2 (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv authored Dec 7, 2024
1 parent 9b6db2e commit cb1db3c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 80 deletions.
54 changes: 0 additions & 54 deletions data/docs/metrics-management/data-storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,60 +67,6 @@ Here the value of the metric is 1 and the timestamp is the time when the metric

How does the SigNoz backend store this data?

There are two versions of the metric data tables in the SigNoz backend:

#### v2 (legacy but continues to be supported for backward compatibility)

There are two tables in the backend database that store the metric data:

- **samples_v2**: This table stores the metric values.
- **timeseries_v2**: This table stores the metadata of the time series such as the metric name, tags, and description.

The `samples_v2` table has the following columns:

- **metric_name**: This is the name of the metric.
- **fingerprint**: This is the hash of the metric name and the tags.
- **value**: This is the value of the metric.
- **timestamp_ms**: This is the timestamp when the metric value was reported in milliseconds.

The `timeseries_v2` table has the following columns:

- **metric_name**: This is the name of the metric.
- **fingerprint**: This is the hash of the metric name and the tags.
- **labels**: This is the tags of the time series.
- **timestamp_ms**: This is the timestamp when the time series was seen for the first time in milliseconds by SigNoz ingestior component since it started. There can be multiple replicas of ingestior components which are independent of each other. This means that the same time series can be reported multiple times from different replicas.

Note: some columns are not shown in the table above for brevity.

The above two tables are joined on the `fingerprint` column to get the metric data. Continuing with the example above, the following is the data that is stored in the `samples_v2` and `timeseries_v2` tables:


**samples_v2 table**

| metric_name | fingerprint | value | timestamp_ms |
| --- | --- | --- | --- |
| active_users | 1234567890 | 1 | 1729430400000 |
| active_users | 1234567890 | 1 | 1729430460000 |
| active_users | 1234567890 | 1 | 1729430520000 |
| active_users | 1234567890 | 1 | 1729430580000 |
| active_users | 1234567890 | 1 | 1729430640000 |
| active_users | 1234567890 | 1 | 1729430700000 |
| active_users | 1234567890 | 1 | 1729430760000 |
| active_users | 1234567890 | 1 | 1729430820000 |
| active_users | 1234567890 | 1 | 1729430880000 |
| active_users | 1234567890 | 1 | 1729430940000 |
| active_users | 1234567890 | 1 | 1729431000000 |
| active_users | 1234567890 | 1 | 1729431060000 |
| active_users | 1234567890 | 1 | 1729431120000 |

**timeseries_v2 table**

| metric_name | fingerprint | labels | timestamp_ms |
| --- | --- | --- | --- |
| active_users | 1234567890 | user_type=paid | 1729430400000 |

#### v4

There are two tables in the backend database that store the metric data:

- **samples_v4**: This table stores the metric values.
Expand Down
26 changes: 0 additions & 26 deletions data/docs/userguide/send-metrics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,32 +183,6 @@ To enable a Prometheus receiver, follow the steps below:
- [Jobs and Instances][6]
3. <SaveChangesRestart />

## Find Metrics available in SigNoz

You can connect to SigNoz's ClickHouse instance and find the metrics SigNoz is storing.
As of now this is bit of manual process, we are bringing capabilities to auto-suggest
available metrics soon.

You can follow the below steps:

1. [Install ClickHouse client][7]

2. Connect to the ClickHouse container
````bash
docker exec -it signoz-clickhouse bash
````
3. Run the clickhouse-client command to connect to the database service
````bash
clickhouse client --host <SigNoz IP> --port 9000
````
4. Run the query to list metrics
````bash
select DISTINCT(JSONExtractString(time_series_v2.labels,'__name__')) as metrics from signoz_metrics.distributed_time_series_v2
````
5. If needed, dump in a csv file and parse it locally
```bash
select DISTINCT(labels) from signoz_metrics.distributed_time_series_v2 INTO OUTFILE 'output.csv'
```

You can use this metrics to plot in the [Dashboard][8] section.

Expand Down

0 comments on commit cb1db3c

Please sign in to comment.