Skip to content
Streamkap
Esc
↑↓navigate↵open⌘Jpreview

Get Metrics For Source

Retrieve metrics for a specific source based on the provided parameters.

This endpoint returns metrics data for a given source ID, allowing flexibility in the type of metrics returned (timeseries, timesummary, or latest), the time interval, and the time range. The response includes metadata about the metrics and is tailored to the specified time type.

Parameters:

  • source_id (path): The unique identifier of the source for which metrics are requested.
  • time_type (query): Specifies the type of metrics to return:
    • timeseries: Metrics over a series of time intervals.
    • timesummary: Aggregated summary of metrics over the specified period.
    • latest: The most recent metrics available.
  • time_interval (query): The numeric interval between metrics data points (e.g., 1, 2, etc.).
  • time_unit (query): The unit of time for the interval (e.g., minute, hour, day, week, month). Combined with time_interval to define the granularity (e.g., 1 hour, 2 days).
  • timestamp_from (query, optional): The start time of the metrics data in UTC (ISO 8601 format, e.g., 2025-03-02T07:10:15Z). Defaults to 24 hours before the current time if not provided.
  • timestamp_to (query, optional): The end time of the metrics data in UTC (ISO 8601 format). Defaults to the current time if not provided.

Authentication:

  • Requires a valid user token with the read:source_metrics permission.

Returns:

Depending on the time_type:

  • SourceTimeseriesMetricsWithMetadata: For timeseries metrics.
  • SourceTimesummaryMetricsWithMetadata: For timesummary metrics.
  • SourceLatestMetricsWithMetadata: For latest metrics.

Errors:

  • 400 Bad Request: Invalid parameters or unexpected errors during processing.
  • 404 Not Found: Metrics not found for the specified source or connector plugin issues.
  • 500 Internal Server Error: Connector plugin not found or misconfigured.

Example Request:

https://api.streamkap.com/sources/67ad6e0af08a2365c729ba79/metrics?time_type=latest&time_interval=2&time_unit=hour&timestamp_from=2025-03-02T07:10:15Z&timestamp_to=2025-03-04T07:10:15Z

Example Response:

{
    "data": {
        "SnapshotTotalNumberOfEventsSeen": 20254,
        "SnapshotMilliSecondsSinceLastEvent": 0,
        "StreamingMilliSecondsBehindSource": 0,
        "StreamingTotalNumberOfDeleteEventsSeen": 312,
        "StreamingTotalNumberOfUpdateEventsSeen": 0,
        "StreamingTotalNumberOfCreateEventsSeen": 73,
        "StreamingMilliSecondsSinceLastEvent": 0,
        "StreamingLastEvent": "position: {ord: 14}, key: {"id" : ""ceaafb88-2a60-4bd9-8515-719ba64ea05c-close""}",
        "recordRetryTotal": null,
        "byteTotal": 9018776,
        "sourceRecordWriteTotal": 28977,
        "SnapshotRunning": 0,
        "SnapshotCompleted": 0,
        "StreamingConnected": 1,
        "recordSendTotal": null,
        "state": "Streaming",
        "streamingState": "connected",
        "snapshotStatus": [
            {
                "status": "completed",
                "topic_id": "source_67a5c35e64af6fd83f4c17a6.Test.test_data1",
                "submit_timestamp": null
            },
            {
                "status": "completed",
                "topic_id": "source_67a5c35e64af6fd83f4c17a6.Test.test_data2",
                "submit_timestamp": null
            }
        ],
        "snapshotState": "completed",
        "recordWrittenTotal": null,
        "connector_status": "Active",
        "latency": 0
    },
    "metadata": {
        "state": {
            "name": "Enabled State",
            "unit": "enum"
        },
        "streamingState": {
            "name": "Streaming State",
            "unit": "enum"
        },
        "snapshotStatus": {
            "name": "Snapshot Status",
            "unit": "enum"
        },
        "snapshotState": {
            "name": "Snapshot State",
            "unit": "enum"
        },
        "connector_status": {
            "name": "Source State",
            "unit": "enum"
        },
        "latency": {
            "name": "Source Latency",
            "unit": "milliseconds"
        },
        "byteTotal": {
            "name": "Volume",
            "unit": "bytes"
        },
        "recordRetryTotal": {
            "name": "Retried",
            "unit": "count"
        },
        "recordSendTotal": {
            "name": "Received",
            "unit": "count"
        },
        "recordWrittenTotal": {
            "name": "Events Written",
            "unit": "count"
        },
        "SnapshotTotalNumberOfEventsSeen": {
            "name": "Events (Snapshot)",
            "unit": "count"
        },
        "SnapshotRunning": {
            "name": "Snapshot Running?",
            "unit": "boolean"
        },
        "SnapshotCompleted": {
            "name": "Snapshot Completed?",
            "unit": "boolean"
        },
        "SnapshotMilliSecondsSinceLastEvent": {
            "name": "Time Since Last Snapshot Event",
            "unit": "milliseconds"
        },
        "StreamingMilliSecondsBehindSource": {
            "name": "Latency Behind Source",
            "unit": "milliseconds"
        },
        "StreamingConnected": {
            "name": "Streaming Connected?",
            "unit": "boolean"
        },
        "StreamingTotalNumberOfDeleteEventsSeen": {
            "name": "Events (Delete)",
            "unit": "count"
        },
        "StreamingTotalNumberOfUpdateEventsSeen": {
            "name": "Events (Update)",
            "unit": "count"
        },
        "StreamingTotalNumberOfCreateEventsSeen": {
            "name": "Events (Create)",
            "unit": "count"
        },
        "StreamingMilliSecondsSinceLastEvent": {
            "name": "Time Since Last Streaming Event",
            "unit": "milliseconds"
        },
        "StreamingLastEvent": {
            "name": "Last Streaming Event",
            "unit": "id"
        },
        "sourceRecordWriteTotal": {
            "name": "Events Written",
            "unit": "count"
        }
    }
}
GET/sources/{source_id}/metrics
Authorization
AuthorizationBearer token · headerrequired
Path parameters
source_idstringrequired
Query parameters
time_typestring

Type of the metrics.

default: "latest"
Allowed:timeseriestimesummarylatest
time_intervalinteger

The interval between each metrics data point.

default: 1
time_unitstring

The unit of the time interval. Combined with time_interval to determine the interval between each metrics data point. For example, if time_interval=1 and time_unit=hour, the interval between each metrics data point is 1 hour.

default: "hour"
Allowed:minutehourdayweekmonth
timestamp_fromstring<date-time>

Start time of the metrics data in UTC timezone. If not provided, start time is set to 24 hours before the current time.

timestamp_tostring<date-time>

End time of the metrics data in UTC timezone. If not provided, end time is set to the current time.

Responses
200

Successful Response

Any of:
SourceTimeseriesMetricsWithMetadata
dataSourceTimeseriesMetricsrequired

Source timeseries metrics.

Show properties
SnapshotMilliSecondsSinceLastEventTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

SnapshotTotalNumberOfEventsSeenTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

StreamingMilliSecondsBehindSourceTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

StreamingMilliSecondsSinceLastEventTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

StreamingTotalNumberOfCreateEventsSeenTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

StreamingTotalNumberOfDeleteEventsSeenTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

recordSendTotalTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

StreamingTotalNumberOfUpdateEventsSeenTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

recordRetryTotalTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

recordWrittenTotalTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

byteTotalTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

sourceRecordWriteTotalTimeseriesEntry[]
default: []
Show properties
Array of TimeseriesEntry
valueinteger | numberrequired

The metric value at this timestamp

Show properties
Any of:
integer
integer
number
number
timestampstringrequired

ISO 8601 timestamp for this data point

metadataobjectrequired
SourceLatestMetricsWithMetadata
dataSourceLatestMetricsrequired

Source latest metrics.

Show properties
SnapshotTotalNumberOfEventsSeeninteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
SnapshotMilliSecondsSinceLastEventinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingMilliSecondsBehindSourcenumber | string | null
Show properties
Any of:
number
number
string
string
null
null
StreamingTotalNumberOfDeleteEventsSeeninteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingTotalNumberOfUpdateEventsSeeninteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingTotalNumberOfCreateEventsSeeninteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingMilliSecondsSinceLastEventinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingLastEventstring | null
Show properties
Any of:
string
string
null
null
recordRetryTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
byteTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
sourceRecordWriteTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
SnapshotRunninginteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
SnapshotCompletedinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingConnectedinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
recordSendTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
statestring | null
Show properties
Any of:
string
string
null
null
streamingStatestring | null
Show properties
Any of:
string
string
null
null
snapshotStatusobject[] | null
default: []
Show properties
Any of:
object[]
Array of object
object
null
null
snapshotStatestring | null
Show properties
Any of:
string
string
null
null
recordWrittenTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
connector_statusstring | null
Show properties
Any of:
string
string
null
null
latencynumber | string | null
Show properties
Any of:
number
number
string
string
null
null
metadataobjectrequired
SourceTimesummaryMetricsWithMetadata
dataSourceTimesummaryMetricsrequired

Source timesummary metrics.

Show properties
SnapshotTotalNumberOfEventsSeeninteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
SnapshotMilliSecondsSinceLastEventinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingMilliSecondsBehindSourcenumber | string | null
Show properties
Any of:
number
number
string
string
null
null
StreamingTotalNumberOfDeleteEventsSeeninteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingTotalNumberOfUpdateEventsSeeninteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingTotalNumberOfCreateEventsSeeninteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
StreamingMilliSecondsSinceLastEventinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
recordRetryTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
recordSendTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
recordWrittenTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
byteTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
sourceRecordWriteTotalinteger | string | null
Show properties
Any of:
integer
integer
string
string
null
null
snapshotStatusobject[] | null
default: []
Show properties
Any of:
object[]
Array of object
object
null
null
snapshotStatestring | null
Show properties
Any of:
string
string
null
null
connector_statusstring | null
Show properties
Any of:
string
string
null
null
latencynumber | string | null
Show properties
Any of:
number
number
string
string
null
null
metadataobjectrequired
422

Validation Error

detailValidationError[]
Show properties
Array of ValidationError
locstring | integer[]required
Show properties
Array of string | integer
Any of:
string
string
integer
integer
msgstringrequired
typestringrequired
inputany
ctxobject
Request
curl -X GET 'https://api.streamkap.com/sources/string/metrics' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "data": {
    "SnapshotMilliSecondsSinceLastEvent": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 500
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 300
      }
    ],
    "SnapshotTotalNumberOfEventsSeen": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 100
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 150
      }
    ],
    "StreamingMilliSecondsBehindSource": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 1000
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 800
      }
    ],
    "StreamingMilliSecondsSinceLastEvent": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 200
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 150
      }
    ],
    "StreamingTotalNumberOfCreateEventsSeen": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 20
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 35
      }
    ],
    "StreamingTotalNumberOfDeleteEventsSeen": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 5
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 8
      }
    ],
    "StreamingTotalNumberOfUpdateEventsSeen": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 30
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 45
      }
    ],
    "byteTotal": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 10000
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 15000
      }
    ],
    "recordRetryTotal": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 2
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 3
      }
    ],
    "recordSendTotal": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 50
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 70
      }
    ],
    "recordWrittenTotal": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 40
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 60
      }
    ],
    "sourceRecordWriteTotal": [
      {
        "timestamp": "2025-03-02 08:00:00",
        "value": 25
      },
      {
        "timestamp": "2025-03-02 09:00:00",
        "value": 40
      }
    ]
  },
  "metadata": {
    "property1": {
      "property1": "string",
      "property2": "string"
    },
    "property2": {
      "property1": "string",
      "property2": "string"
    }
  }
}