Skip to content

Prometheus semconvs#17868

Draft
ArthurSens wants to merge 25 commits intomainfrom
prometheus-semconvs
Draft

Prometheus semconvs#17868
ArthurSens wants to merge 25 commits intomainfrom
prometheus-semconvs

Conversation

@ArthurSens
Copy link
Member

Super heavy WIP

Currently, I'm just playing around with replacing our existing internal telemetry with auto-generated instrumentation from OTel Schemas+Weaver

This is related to the consensus we had in previous Dev Summits[1], I just couldn't find the time to work on it yet 😬 .

Yeah, LOC is huge. If this move forwards I'll work on breaking this down, but for now I'm playing around with what's possible

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
with:
persist-credentials: false
- name: Set up Weaver
uses: open-telemetry/weaver/setup-weaver@v0.20.0

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 7: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks!

Added some questions. I propose we offload as much of shared things to client_golang. Then I would focus on migrating only one package, so we can nail the details on API etc.

Copy link
Member

Choose a reason for hiding this comment

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

  1. Should we make those internal so it's not imported?
  2. Can we add some .gen.go suffix to make it clear it's generated?

Copy link
Member Author

Choose a reason for hiding this comment

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

good ideas

// defined in this semantic convention registry.
package metrics

import (
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be hosted on client_golang?

Copy link
Member Author

Choose a reason for hiding this comment

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

If the alternatives are here or client_golang, agreed that client_golang would be better :)

I've added here just while I was playing around with the code. We can definitely move if we're committed to this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

FYI: Weaver is moving towards changing their packaging, so Weaver includes default templates and policies in their distribution. We could include prometheus SDK templates and policies there, that way we could just use weaver and nothing else :)

See open-telemetry/weaver#1145 (comment)

# =============================================================================
# Rule 1: Histogram metrics MUST have annotations.prometheus.histogram_type
# =============================================================================
deny contains metric_violation(
Copy link
Member

Choose a reason for hiding this comment

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

ditto - hosting it in client_golang probably make more sense?

Copy link
Member

Choose a reason for hiding this comment

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

Then we can simply wget this from GitHub URL

if _, ok := seen[us]; ok {
continue
}
s.metrics.latencySummary.SummaryVec.DeleteLabelValues(us)
Copy link
Member

Choose a reason for hiding this comment

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

I agree with lint - why do you want to have SummaryVec explicit? We can skip it.

}

// This will initialize the Counters for the AM to 0.
s.metrics.sent.With(metrics.AlertmanagerAttr(us))
Copy link
Member

Choose a reason for hiding this comment

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

Hm.. have we benchmarked to decided on the final API? Is this fast enough for hot-paths in some Prometheus places? I wonder if there's something to optimize here. I guess supporting WithAlertmanager(string) as an option would be helpful for those cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

No benchmarks yet, and agreed we should explore different implementations and compare the results!

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