Skip to content

Conversation

@jan-auer
Copy link
Member

@jan-auer jan-auer commented Nov 23, 2023

DDM wants to show code locations with metrics. Locations are semi-static information: they change infrequently, so they don't need to be reported with every data point.

Sentry expects locations to be reported at least once per day. With backdating of metrics, the timestamp used to report the location is the metric bucket's timestamp rounded down to the start of the day (UTC timezone).

The metrics aggregator keeps a cache of previously reported locations. When a location is seen for the first time on a day, it is added to a list of pending locations. On the next flush cycle, all pending locations are sent to Sentry in the same envelope as the metric buckets.

See: getsentry/relay#2751
Epic: getsentry/sentry#60260

@jan-auer jan-auer force-pushed the feature/code-locations branch from 019f82a to 9a86bd0 Compare November 23, 2023 08:44
@jan-auer jan-auer requested a review from antonpirker November 23, 2023 12:22
@jan-auer jan-auer self-assigned this Nov 23, 2023
@jan-auer jan-auer marked this pull request as ready for review November 23, 2023 12:26
@jan-auer jan-auer requested a review from Dav1dde November 23, 2023 12:26
@antonpirker
Copy link
Contributor

The mock imports should be like this to work everywhere:

try:
    from unittest import mock  # python 3.3 and above
except ImportError:
    import mock  # python < 3.3

Copy link
Contributor

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

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

Looks good. I few minor changes I mentioned.

Copy link
Contributor

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

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

Looks good! 🚢

@antonpirker antonpirker merged commit a67914c into master Nov 24, 2023
@antonpirker antonpirker deleted the feature/code-locations branch November 24, 2023 08:29
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.

5 participants