Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Add schema registry metrics #77

Merged
merged 2 commits into from
Jun 7, 2021
Merged

Conversation

sebco59
Copy link
Contributor

@sebco59 sebco59 commented Jun 3, 2021

Add schema registry metrics in order to expose schema count (based on the connector_ksql.go)

A new resource type is available schema_registry (https://api.telemetry.confluent.cloud/docs)

curl https://api.telemetry.confluent.cloud/v2/metrics/cloud/descriptors/metrics?resource_type=schema_registry

and is in GA !

{
    "data": [
        {
            "name": "io.confluent.kafka.schema_registry/schema_count",
            "description": "The number of registered schemas.",
            "type": "GAUGE_INT64",
            "unit": "1",
            "lifecycle_stage": "GENERAL_AVAILABILITY",
            "labels": []
        }
    ],
    "meta": {
        "pagination": {
            "page_size": 100,
            "total_size": 1
        }
    },
    "links": {}
}

Metrics can be get by this call

curl --request POST 'https://api.telemetry.confluent.cloud/v2/metrics/cloud/query' \
    --data-raw '{
        "aggregations": [
            {
                "agg": "SUM",
                "metric": "io.confluent.kafka.schema_registry/schema_count"
            }
        ],
        "filter": {
            "filters": [
                {
                    "field": "resource.schema_registry.id",
                    "op": "EQ",
                    "value": "lsrc-abcde"
                }
            ],
            "op": "AND"
        },
        "granularity": "PT1M",
        "group_by": [
        ],
        "intervals": [
            "2021-06-03T10:00:00+01:00/2021-06-03T11:00:00+01:00"
        ],
        "limit": 500
    }'

@sebco59
Copy link
Contributor Author

sebco59 commented Jun 3, 2021

Fix #64

@Dabz
Copy link
Owner

Dabz commented Jun 7, 2021

Thanks @sebco59 for the PR. It looks good to me. Let me merge it, a new docker image should be available a few minutes after the merge.

@Dabz Dabz merged commit 8d66630 into Dabz:master Jun 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants