Dabz / ccloudexporter

Prometheus exporter for Confluent Cloud API metric
https://docs.confluent.io/current/cloud/metrics-api.html
87 stars 53 forks source link

Collect schema_registry metrics (initial io.confluent.kafka.schema_registry/schema_count) #64

Open javabrett opened 3 years ago

javabrett commented 3 years ago

V2 API added resource io.confluent.kafka.schema_registry and an initial metric io.confluent.kafka.schema_registry/schema_count. Exporter could collect this metric.

Sample query:

{
    "aggregations": [
        {
            "agg": "SUM",
            "metric": "io.confluent.kafka.schema_registry/schema_count"
        }
    ],
    "filter": {
        "field": "resource.schema_registry.id",
        "op": "EQ",
        "value": "lsrc-xxxxx"
    },
    "granularity": "PT1H",
    "intervals": [
        "2021-02-23T11:00:00+11:00/P0Y0M0DT1H0M0S"
    ],
    "group_by": [
    "resource.schema_registry.id"
    ]
}

Example response/metric:

{
    "aggregations": [
        {
            "agg": "SUM",
            "metric": "io.confluent.kafka.schema_registry/schema_count"
        }
    ],
    "filter": {
        "field": "resource.schema_registry.id",
        "op": "EQ",
        "value": "lsrc-xxxxx"
    },
    "granularity": "PT1H",
    "intervals": [
        "2021-02-23T11:00:00+11:00/P0Y0M0DT1H0M0S"
    ],
    "group_by": [
    "resource.schema_registry.id"
    ]
}
{
    "data": [
        {
            "timestamp": "2021-02-23T00:00:00Z",
            "value": 9.0,
            "resource.schema_registry.id": "lsrc-rw6m7"
        }
    ]
}