Skip to main content

sql.go

sql.go - Overview

This file contains the function generateOverviewSQL that constructs a ClickHouse SQL query to retrieve overview metrics for messaging queues, including throughput, error percentage, and P95 latency. The query filters data based on a provided time range and optional filter items (service name, span name, destination, queue, and kind).

Detailed Documentation

generateOverviewSQL

Purpose: Builds a ClickHouse SQL query to fetch overview metrics related to messaging queues. It filters data by time range and other specified filters and aggregates the results to compute throughput, error percentage, and P95 latency.

Parameters:

  • start (int64): The start timestamp in nanoseconds.
  • end (int64): The end timestamp in nanoseconds.
  • item ([]v3.FilterItem): A slice of FilterItem structs used to apply additional filters to the query (e.g., service name, span name).

Returns:

  • string: A ClickHouse SQL query string.

Code Examples

Not applicable, as the function's primary purpose is to construct an SQL query string.

Getting Started Relevance

Include in Getting Started: NO