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

Dont use globals for the tc metrics settings #343

Merged
merged 9 commits into from
Dec 3, 2024

Conversation

matt-richardson
Copy link
Contributor

@matt-richardson matt-richardson commented Nov 29, 2024

Background

I had success all during testing for the metrics shipping, but as soon as I merged and used the prod one, it stopped working.

image

Interestingly, it started working after teamcity was restarted due to cluster upgrade. This suggests to me that the global was getting into a bad state due to concurrency.

This is wise anyway, as we want to avoid the use of the global properties, as it allows metrics per project.

[sc-96078]

Results

We now:

  • no longer set the GlobalOpenTelemetry config
  • add an attribute to the metric, so we can see what build it relates to this was done in Log build id with metrics #348.
  • shutdown the metric reader, so that it doesn't leak threads

After

image

How to review this PR

Pre-requisites

  • I have considered informing or consulting the right people
  • I have considered appropriate testing for my change.

@matt-richardson matt-richardson self-assigned this Nov 29, 2024
@matt-richardson matt-richardson requested a review from a team as a code owner November 29, 2024 00:10
@matt-richardson matt-richardson marked this pull request as draft November 29, 2024 00:16
@matt-richardson matt-richardson marked this pull request as ready for review December 2, 2024 05:02
Copy link

@akirayamamoto akirayamamoto left a comment

Choose a reason for hiding this comment

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

I am not familiar with this project but the idea of the change makes sense to me.
However, the (pair) return and the name of buildSpanProcessorAndMeterProvider sounds like could do with another class in there? Maybe "TelemetryProvider"? This class could have both the spanProcessor and the meterProvider. I haven't put much thought into the ideal solution. I am happy to merge as is though.

@matt-richardson matt-richardson merged commit 5641021 into main Dec 3, 2024
3 checks passed
@matt-richardson matt-richardson deleted the mattr/rsb/no-metrics branch December 3, 2024 05:27
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