Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: instrument otel metrics for pubsub failures (#2200)
- Adds `ftl.status.succeeded` attr to `ftl.pubsub.published` metric - Adds separate subscription and subscriber `module.name` attrs to all metrics except `.published` - Adds `ftl.pubsub.propagation.failed` metric Success case: ``` ScopeMetrics #0 ScopeMetrics SchemaURL: InstrumentationScope ftl.pubsub Metric #0 Descriptor: -> Name: ftl.pubsub.published -> Description: the number of times that an event is published to a topic -> Unit: 1 -> DataType: Sum -> IsMonotonic: true -> AggregationTemporality: Cumulative NumberDataPoints #0 Data point attributes: -> ftl.module.name: Str(echo) -> ftl.pubsub.topic.name: Str(echotopic) -> ftl.status.succeeded: Bool(true) StartTimestamp: 2024-07-30 20:42:41.054792 +0000 UTC Timestamp: 2024-07-30 20:43:01.055944 +0000 UTC Value: 1 Metric #1 Descriptor: -> Name: ftl.pubsub.sink.called -> Description: the number of times that a pubsub event has been enqueued to asynchronously send to a subscriber -> Unit: 1 -> DataType: Sum -> IsMonotonic: true -> AggregationTemporality: Cumulative NumberDataPoints #0 Data point attributes: -> ftl.pubsub.sink.module.name: Str(echo) -> ftl.pubsub.sink.ref: Str(echo.echoSinkOne) -> ftl.pubsub.subscription.module.name: Str(echo) -> ftl.pubsub.subscription.ref: Str(echo.sub) -> ftl.pubsub.topic.name: Str(echotopic) StartTimestamp: 2024-07-30 20:42:41.054797 +0000 UTC Timestamp: 2024-07-30 20:43:01.055965 +0000 UTC Value: 1 ``` Publish error case: ``` Metric #0 Descriptor: -> Name: ftl.pubsub.published -> Description: the number of times that an event is published to a topic -> Unit: 1 -> DataType: Sum -> IsMonotonic: true -> AggregationTemporality: Cumulative NumberDataPoints #0 Data point attributes: -> ftl.module.name: Str(echo) -> ftl.pubsub.publish.error.message: Str(test error) -> ftl.pubsub.topic.name: Str(echotopic) -> ftl.status.succeeded: Bool(false) StartTimestamp: 2024-07-30 20:49:19.294421 +0000 UTC Timestamp: 2024-07-30 20:49:44.294924 +0000 UTC Value: 1 ``` Progressing subscribers error case with subscriber defined: ``` Metric #1 Descriptor: -> Name: ftl.pubsub.propagation.failed -> Description: the number of times that subscriptions fail to progress -> Unit: 1 -> DataType: Sum -> IsMonotonic: true -> AggregationTemporality: Cumulative NumberDataPoints #0 Data point attributes: -> ftl.pubsub.propagation.failed_operation: Str(BeginConsumingTopicEvent) -> ftl.pubsub.sink.module.name: Str(echo) -> ftl.pubsub.sink.ref: Str(echo.echoSinkOne) -> ftl.pubsub.subscription.module.name: Str(echo) -> ftl.pubsub.subscription.ref: Str(echo.sub) -> ftl.pubsub.topic.name: Str(echotopic) StartTimestamp: 2024-07-30 20:46:45.475043 +0000 UTC Timestamp: 2024-07-30 20:47:00.476169 +0000 UTC Value: 4 ``` Progressing subscribers error case without subscriber: ``` Metric #1 Descriptor: -> Name: ftl.pubsub.propagation.failed -> Description: the number of times that subscriptions fail to progress -> Unit: 1 -> DataType: Sum -> IsMonotonic: true -> AggregationTemporality: Cumulative NumberDataPoints #0 Data point attributes: -> ftl.pubsub.propagation.failed_operation: Str(GetNextEventForSubscription) -> ftl.pubsub.subscription.module.name: Str(echo) -> ftl.pubsub.subscription.ref: Str(echo.sub) -> ftl.pubsub.topic.name: Str(echotopic) StartTimestamp: 2024-07-30 19:09:10.084914 +0000 UTC Timestamp: 2024-07-30 19:09:25.086338 +0000 UTC Value: 4 ``` Issue: #2194 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information