Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: propagate Publish caller through all pubsub metrics #2231

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

deniseli
Copy link
Contributor

@deniseli deniseli commented Aug 1, 2024

Previously, only ftl.pubsub.published had the caller attribute. This PR adds caller to the rest of the pubsub metrics and also slightly restructures the topic name/ref logging to be more consistent with the rest of this file

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.caller.verb.ref: Str(echo.Echo)
     -> ftl.pubsub.topic.ref: Str(echo.echotopic)
     -> ftl.status.succeeded: Bool(true)
StartTimestamp: 2024-08-01 01:19:43.556864 +0000 UTC
Timestamp: 2024-08-01 01:20:08.558236 +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.publish.caller.verb.ref: Str(echo.Echo)
     -> 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.module.name: Str(echo)
     -> ftl.pubsub.topic.ref: Str(echo.echotopic)

Issue: #2194

deniseli added 2 commits July 31, 2024 21:22
temp

temp

working
@deniseli deniseli marked this pull request as ready for review August 1, 2024 01:55
@deniseli deniseli requested a review from alecthomas as a code owner August 1, 2024 01:55
@deniseli deniseli requested review from a team and wesbillman and removed request for a team August 1, 2024 01:55
-- migrate:up

ALTER TABLE topic_events
ADD COLUMN caller TEXT NOT NULL;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to have a default (or be nullable), otherwise the migration will fail on existing columns.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops thanks for the reminder!

pubsubTopicNameAttr = "ftl.pubsub.topic.name"
pubsubCallerVerbNameAttr = "ftl.pubsub.publish.caller.verb.name"
pubsubTopicRefAttr = "ftl.pubsub.topic.ref"
pubsubTopicModuleAttr = "ftl.pubsub.topic.module.name"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different to .ref above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're the same, but the consensus in Slack (with the rest of the otel folks) was to just log both. It is possible to filter by module-only using the ref by doing a string match in datadog, but that's a little more annoying than having this attr here. WDYT? I could just remove the duplicated module attrs everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh hmm it looks like DD's "split graph" feature doesn't support any special string matching; you have to just pick an attribute and it slices all the graphs by that. So that would be an argument to keep module in there :/

@deniseli deniseli force-pushed the dli/persist-caller branch from f0d5f07 to 06fced5 Compare August 1, 2024 17:14
@deniseli deniseli merged commit c38a754 into main Aug 1, 2024
64 checks passed
@deniseli deniseli deleted the dli/persist-caller branch August 1, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants