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

Support explicit view hints; support synchronous Gauge configuration #185

Merged
merged 6 commits into from
Jun 21, 2022

Conversation

jmacd
Copy link
Member

@jmacd jmacd commented Jun 17, 2022

Description:
Allows metric instruments with JSON body in their description to achieve a programmatic view configuration.
This enables three things for Lightstep's internal use:

  1. Can select a Gauge aggregator for an UpDownCounter instrument
  2. Can select a MinMaxSumCount aggregator programmatically
  3. Can configure Histogram buckets w/o views

Link to tracking Issue:
LS-30446: additional configuration needed to adapt Lightstep-internal metrics libraries

Documentation: Comments in code; requires README before this merges to the main branch.


var hint view.Hint
if err := json.Unmarshal([]byte(instrument.Description), &hint); err != nil {
// This could be noisy if valid descriptions contain spurious '{' chars.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way we could make the hinting more explicit to avoid potential noise here?

Copy link
Member Author

@jmacd jmacd Jun 21, 2022

Choose a reason for hiding this comment

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

An explicit hint could be accomplished with the OTel API if the API changes--this is a standing feature request. For the way we have planned, there won't be noise because the source has no metric descriptions, and if it did it knows how to wrap them in JSON syntax to do the right thing.

To avoid this side-channeling, we could use a separate data structure, possibly with a more-explicit back-channel into the viewstate code to achieve the override. I would document this as experimental support aimed at helping understand the need for hints in the OTel API; users would be advised to be careful and plan on switching to a hints API in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

i see, maybe for now this is fine then. I think explicit hinting via the otel API is the right way to go, and after this is merged and in use, we'll have a use case to show for it.

@jmacd jmacd merged commit 08fc7ce into alt_metrics_sdk/reviewed Jun 21, 2022
@jmacd jmacd deleted the jmacd/viewhint branch June 21, 2022 15:39
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.

None yet

2 participants