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

Updated Prometheus to 1.2.1 #2145

Merged
merged 4 commits into from
Apr 25, 2024
Merged

Updated Prometheus to 1.2.1 #2145

merged 4 commits into from
Apr 25, 2024

Conversation

Pask423
Copy link
Contributor

@Pask423 Pask423 commented Apr 23, 2024

closes #2011

@Pask423 Pask423 requested a review from adamw April 23, 2024 07:32
summaries.remove(collectorRegistry)
def clear(prometheusRegistry: PrometheusRegistry): Unit = {
unregister(prometheusRegistry, histograms)
histograms.remove(prometheusRegistry)
Copy link
Member

Choose a reason for hiding this comment

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

the .remove could be part of the unregister maybe?

cache: mutable.WeakHashMap[CollectorRegistry, ConcurrentHashMap[String, T]],
collectorRegistry: CollectorRegistry
cache: mutable.WeakHashMap[PrometheusRegistry, ConcurrentHashMap[String, T]],
prometheusRegistry: PrometheusRegistry
): ConcurrentHashMap[String, T] =
cache.synchronized {
Copy link
Member

Choose a reason for hiding this comment

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

as a follow-up task, we should remove the .synchronized, as it shouldn't be used in Java21+, and repalce it with some kind of a concurrent data structure (or improve the cache in general)

Copy link
Member

Choose a reason for hiding this comment

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

or maybe we can do it right away, this is invoked only during the backend's construction, so a simple lock should suffice in fact; but we should also protect the cleanup method, then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how about separate PR focused on cache I would prefer not to mix it with this update

Copy link
Member

Choose a reason for hiding this comment

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

ok :)

@@ -1,8 +1,11 @@
package sttp.client4.prometheus

import io.prometheus.metrics.core.datapoints.{GaugeDataPoint, Timer}
Copy link
Member

Choose a reason for hiding this comment

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

another follow-up task: in tapir, we are using some standardized labels for the http metrics; I suspect there might be some standards for opentelemetry / prometheus as well. If so, we should probably use these by default

Copy link
Member

@kciesielski kciesielski left a comment

Choose a reason for hiding this comment

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

This probably should get backported to the v3 branch after it's merged, right @adamw?

@adamw
Copy link
Member

adamw commented Apr 25, 2024

@kciesielski I don't know, it's a breaking change, although in an integration module ... let's see if somebody will need it ;)

@Pask423 Pask423 mentioned this pull request Apr 25, 2024
@Pask423 Pask423 merged commit 6d86f81 into master Apr 25, 2024
15 checks passed
@Pask423 Pask423 deleted the prometheus-update branch April 25, 2024 08:51
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.

Update to Prometheus 1.x.x
3 participants