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

feat: agent and broker expose OTEL metrics #10264

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

alexghr
Copy link
Contributor

@alexghr alexghr commented Nov 28, 2024

This PR adds instrumentation to both the proving broker and agent.

Comment on lines -277 to -278
const storeSizes = this.store.estimateSize();
this.instrumentation.recordDBMetrics(storeSizes);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These stats are now automatically captured using observables.

@alexghr alexghr marked this pull request as ready for review November 28, 2024 16:00
}
const metrics = this.getStats();
observable.observe(this.dbMapSize, metrics.mappingSize);
observable.observe(this.dbNumItems, metrics.actualSize);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh this is a typo on my part. That should be metrics.numItems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed! Totally missed it haha, nice catch

) {
this.dbMapSize = meter.createGauge(dbMapSizeDescriptor.name, {
this.dbMapSize = meter.createObservableGauge(dbMapSizeDescriptor.name, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This observable approach is much better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants