Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

feat: allow users to opt out of internal SDK metrics#143

Merged
LukeWinikates merged 4 commits intomasterfrom
internal-metrics-optional
Aug 18, 2023
Merged

feat: allow users to opt out of internal SDK metrics#143
LukeWinikates merged 4 commits intomasterfrom
internal-metrics-optional

Conversation

@LukeWinikates
Copy link
Copy Markdown
Contributor

@LukeWinikates LukeWinikates commented Jul 24, 2023

See #35

@suprajanarasimhan suprajanarasimhan force-pushed the internal-metrics-optional branch from 1c4ac36 to 62d97a9 Compare August 8, 2023 00:06
@suprajanarasimhan suprajanarasimhan marked this pull request as ready for review August 8, 2023 00:10
@suprajanarasimhan

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor Author

@LukeWinikates LukeWinikates left a comment

Choose a reason for hiding this comment

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

@suprajanarasimhan what do you think about moving a few of these files into a sub-package to make the organization more obvious:

registry, real_metric_registry, and noop_registry could all move from internal to internal/sdkmetrics or something like that.

@suprajanarasimhan
Copy link
Copy Markdown
Contributor

suprajanarasimhan commented Aug 10, 2023

@suprajanarasimhan what do you think about moving a few of these files into a sub-package to make the organization more obvious:

registry, real_metric_registry, and noop_registry could all move from internal to internal/sdkmetrics or something like that.

I like it because this would really highlight the bigger picture purpose of these files. Do you mind if I try that move? I've never dealt with sub-packages before and I think it would be a good learning experience. (I don't have time to do it today, but I could revisit this tomorrow morning).

Update: I did this. I also moved one more file from package internal to package sdkmetrics: metrics.go.

@suprajanarasimhan
Copy link
Copy Markdown
Contributor

Thanks a lot for the first round of comments, @LukeWinikates! I think it exposed me to some helpful practices and patterns.

@suprajanarasimhan suprajanarasimhan self-requested a review August 10, 2023 23:13
@LukeWinikates LukeWinikates force-pushed the internal-metrics-optional branch from 329f90a to 01210db Compare August 14, 2023 18:53
@LukeWinikates LukeWinikates force-pushed the internal-metrics-optional branch from 71a4432 to 14e8a36 Compare August 16, 2023 18:12
@LukeWinikates LukeWinikates changed the title feat: allow users to disable internal SDK metrics feat: allow users to opt out of internal SDK metrics Aug 17, 2023
LukeWinikates and others added 4 commits August 17, 2023 13:49
- create a no-op registry when not sending internal metrics
- simplify repetitive pattern with instrumenting line formatter -> handler with instrumentation
- make types unexported where possible
- introduce test helper function
- introduce internal 'sdkmetrics' package
- reorganize files
- backfill unit tests for Send* methods on *wavefrontSender
- change LineHandler fields to interfaces
- fix a bug in trySendWith
- rename internalMetricFamily to realSuccessTracker
- fix some style spots, some doc strings
- add a Flush() method to the internal sdk metric registry, and use it in e2e tests
- reformat some long method signatures
- add a happy-path test for realRegistry
@LukeWinikates LukeWinikates force-pushed the internal-metrics-optional branch from 53d90eb to f779506 Compare August 17, 2023 20:54
@LukeWinikates LukeWinikates merged commit fb1a1cf into master Aug 18, 2023
@LukeWinikates LukeWinikates deleted the internal-metrics-optional branch August 18, 2023 03:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants