SigNoz / signoz

SigNoz is an open-source observability platform native to OpenTelemetry with logs, traces and metrics in a single application. An open-source alternative to DataDog, NewRelic, etc. 🔥 🖥. 👉 Open source Application Performance Monitoring (APM) & Observability tool
https://signoz.io
Other
18.57k stars 1.19k forks source link

Table View #2842

Closed ankitnayan closed 1 year ago

ankitnayan commented 1 year ago

Add a table view as new type apart from existing timeseries and value type views for charts.

The table view is very similar to the timeseries type, except that the result is rendered in a table instead of a line graph. The major difference is that the aggregation is performed for the whole duration, i.e., stepInterval is the same as the total duration the user selects. The rest of the sub-components in the query builder remain the same. The "Aggregation every" initially will be (end-start) in seconds.

frontend

Following is the sample UI. Here the aggregate operator is AVG and the aggregate attribute is system.cpu.user with groupBy as host and cluster

Screenshot 2023-06-08 at 9 15 42 AM
Sample response from the backend will be. ```json { "status": "success", "data": { "resultType": "table", "result": [ { "queryName": "A", "series": [ { "labels": {"host": "pranay-vm-1", "cluster": "signoz-cluster-1"}, "values": [ { "timestamp": 1686194430000, "value": "11.6" } ] }, { "labels": {"host": "pranay-vm-2", "cluster": "signoz-cluster-1"}, "values": [ { "timestamp": 1686194430000, "value": "10.6" } ] }, { "labels": {"host": "aws-node-2", "cluster": "signoz-cluster-3"}, "values": [ { "timestamp": 1686194430000, "value": "4.6" } ] }, { "labels": {"host": "aws-node-1", "cluster": "signoz-cluster-3"}, "values": [ { "timestamp": 1686194430000, "value": "1.6" } ] } ], "list": null } ] } } ```

Multiple queries

It is certainly possible that there will be more than one query. Each aggregation gets its own column. The most basic example could be the Key Operations from the Service Overview page.

Screenshot 2023-06-08 at 9 26 14 AM

In the above screenshot, every aggregation column corresponds to a query in the builder, with each having groupBy name.

Different groupBy

Since each query is independent of other queries, there can be a scenario where groupBy is different. The number of columns will be a unique set of groupBy keys in the result, along with a column for each aggregation. Whenever something is unknonn, the cell will show n/a. For example, there is no P99 for the host-cluster, so we show n/a. Take the above two scenarios; the user wants to see the host metrics and latencies table. The result table will be of the following.

host cluster name avg(systme.cpu.user) p99 p95 p50 num of calls error rate
pranay-vm-1 signoz-cluster-1 n/a 11.6 n/a n/a n.a n/a n/a
pranay-vm-2 signoz-cluster-1 n/a 10.0 n/a n/a n/a n/a n/a
signoz-node-2 signoz-cluster-3 n/a 4.6 n/a n/a n/a n/a n/a
signoz-node-1 signoz-cluster-3 n/a 1.6 n/a n/a n/a n/a n/a
n/a n/a HTTP GET /dispatch n/a 714.78 988.45 1198.01 1652 0.00
n/a n/a HTTP GET: /customer n/a 313.45 594.18 808.46 1652 0.00
n/a n/a HTTP GET n/a 52.61 310.21 503.75 18172 0.00
n/a n/a /driver.DriverService/FindNearest n/a 206.62 236.79 245.33 1653 0.00
n/a n/a HTTP GET: /route n/a 51.26 71.20 80.80 16520 0.00

The above example is entirely mutually exclusive. It is very common but possible. The middle ground is there will be overlapping groupBy.

srikanthccv commented 1 year ago

I have added the details for this panel type. Please let me know if there are questions or concerns.

srikanthccv commented 1 year ago

@palashgdev, please check the expected behaviour from the frontend and ask if there are questions around it.

palashgdev commented 1 year ago

@srikanthccv can we have same the response that client would be rendering ?

makeavish commented 1 year ago

Examples of column names:

  1. Column names: Count - A, Count - B Screenshot 2023-07-14 at 14 51 05
  2. Column names: Count(level) - A, Count - test 2 Screenshot 2023-07-14 at 14 53 08
  3. Column names: Count(level) - test 1, Count(level) - test 2, F1(A+B) Screenshot 2023-07-14 at 14 54 32
  4. Column names: Count(level) - test 1, Count(level) - test 2, F1(A+B) - Formula test Screenshot 2023-07-14 at 14 55 52
srikanthccv commented 1 year ago

This is done