Accepting request 1226520 from Java:packages
0.16.0 OBS-URL: https://build.opensuse.org/request/show/1226520 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/prometheus-simpleclient-java?expand=0&rev=9
This commit is contained in:
commit
86aaa90614
3
parent-0.16.0.tar.gz
Normal file
3
parent-0.16.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:ec559ab546f5af67670afe747022fe198088ea5a5baafa3071747a9ccb927fe4
|
||||||
|
size 245785
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:4e2567d9b6baaa2043d0487ab8d9524a266519be3b4848a41a80ad2a74915a9a
|
|
||||||
size 162801
|
|
@ -1,3 +1,122 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 26 11:30:00 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||||
|
|
||||||
|
- Update to upstream version 0.16.0
|
||||||
|
* Bugfixes:
|
||||||
|
+ Don't throw NPE if .help() wasn't called
|
||||||
|
+ Don't wrap a RuntimeException in another RuntimeException.
|
||||||
|
+ Make pushgateway module compile on Java 11
|
||||||
|
+ Make sure GZIPOutputStream is always closed for httpserver
|
||||||
|
+ Specify the charset of HTTPServer response for systems not
|
||||||
|
using utf-8 by default
|
||||||
|
+ Use <packaging>bundle</packaging> everywhere so that
|
||||||
|
client_java works with OSGI again.
|
||||||
|
+ use the correct name for the metric type gaugehistogram in
|
||||||
|
OpenMetrics (previously this was wrongly named
|
||||||
|
gauge_histogram)
|
||||||
|
+ Correct handling of HEAD requests.
|
||||||
|
+ Apply ServletConfig during Servlet initialization in
|
||||||
|
simpleclient_servlet and simpleclient_servlet_jakarta
|
||||||
|
+ HTTPServer: Don't send a Content-Length header when
|
||||||
|
Transfer-Encoding is chunked.
|
||||||
|
+ simpleclient_log4j set the log4j dependency scope as provided
|
||||||
|
so that users don't accidentally pull the log4j version used
|
||||||
|
in client_java.
|
||||||
|
Note: This module is for monitoring log4j version 1,
|
||||||
|
in simpleclient_log4j2 the dependency is already provided.
|
||||||
|
+ simpleclient_dropwizard set the Dropwizard dependency scope as
|
||||||
|
provided so that users don't accidentally pull the Dropwizard
|
||||||
|
version used in client_java.
|
||||||
|
+ Fix missing Dropwizard metrics in Vertx.
|
||||||
|
+ Fix incorrect buffer size in the Servlet exporter.
|
||||||
|
+ Fix sample name filter for the JMX metric
|
||||||
|
jvm_memory_bytes_committed.
|
||||||
|
* Enhancements:
|
||||||
|
+ Bump caffeine dependency to 2.7.0 to support AsyncCache.
|
||||||
|
+ Added health check api to simpleclient_httpserver.
|
||||||
|
+ Remove dependency on sun.misc.Unsafe, allowing building on
|
||||||
|
JDK11
|
||||||
|
+ Wrap PrintWriter with BufferedWriter, making servlet
|
||||||
|
exposition about 2x faster
|
||||||
|
+ Handle empty label values for the pushgateway
|
||||||
|
+ Add Bill of Materials
|
||||||
|
+ Count HTTP statuses returned for servlet filter
|
||||||
|
+ Introduce TestContainers integration test, for example for
|
||||||
|
testing different Java versions. This means you need Docker
|
||||||
|
installed to run ./mvnw verify.
|
||||||
|
+ HTTPServer: Set request/response timeouts.
|
||||||
|
+ HTTPServer: Make HTTPMetricHandler public so that it can be
|
||||||
|
used in a custom HTTPServer.
|
||||||
|
+ New JVM memory metrics: jvm_memory_pool_collection_used_bytes,
|
||||||
|
jvm_memory_pool_collection_committed_bytes,
|
||||||
|
jvm_memory_pool_collection_max_bytes,
|
||||||
|
jvm_memory_pool_collection_init_bytes,
|
||||||
|
jvm_memory_objects_pending_finalization.
|
||||||
|
+ Version bumps (junit, jetty, maven plugins)
|
||||||
|
+ add support for Jakarta Servlet, implemented in the new
|
||||||
|
simpleclient_servlet_jakarta module.
|
||||||
|
+ provide a way for filtering metrics by name / name prefix.
|
||||||
|
This can be configured either in the HTTPServer, or in the
|
||||||
|
Servlet exporter (both javax and Jakarta). For example, if
|
||||||
|
some JMX metrics cause performance issues, this can be used
|
||||||
|
for excluding these metrics.
|
||||||
|
+ for the Servlet filter (both javax and Jakarta): Add a
|
||||||
|
parameter to strip the deployment path from the path label.
|
||||||
|
+ Add HTTP Authentication to the HTTPServer #682.
|
||||||
|
+ Allow passing a custom registry to the logback
|
||||||
|
InstrumentedAppender.
|
||||||
|
+ Lots of more integration tests and tests with different Java
|
||||||
|
versions.
|
||||||
|
+ Make HTTPMetricHandler public so that users can use them in
|
||||||
|
their own HttpServers.
|
||||||
|
+ Make Base64 encoding in the HTTP authentication for the
|
||||||
|
PushGateway work with all Java versions.
|
||||||
|
+ The HTTPServer can now be configured to use SSL.
|
||||||
|
+ Lots of dependency version bumps.
|
||||||
|
+ Environment variable PROMETHEUS_DISABLE_CREATED_SERIES=true
|
||||||
|
for disabling _created metrics.
|
||||||
|
+ Support for OpenTelemetry trace sampling: Only traces that are
|
||||||
|
sampled will be used as exemplars.
|
||||||
|
+ Handle thread IDs <= 0. Apparently Apache Zookeeper generates
|
||||||
|
negative thread IDs, which causes issues in jmx_exporter.
|
||||||
|
+ Mark opentelemetry-api as optional to make it an optional
|
||||||
|
dependency in OSGi.
|
||||||
|
+ Move servlet adapters to an internal package to avoid
|
||||||
|
duplicating classes when building OSGi bundles.
|
||||||
|
+ Extend the API of the HTTPServer.Builder to allow custom
|
||||||
|
ExecutorService instances.
|
||||||
|
+ Reduce the number of core threads in HTTPServer from 5 to 1.
|
||||||
|
The HTTPServer will still start up to 5 threads on demand if
|
||||||
|
there are parallel requests, but it will use only 1 thread as
|
||||||
|
long as requests are sequential.
|
||||||
|
+ Optimize metric name sanitization: Replace the regular
|
||||||
|
expression with a hard-coded optimized algorithm to improve
|
||||||
|
performance.
|
||||||
|
+ Lots of dependency version bumps.
|
||||||
|
* Changes:
|
||||||
|
+ Switch data model to OpenMetrics. Primarily this means that
|
||||||
|
_total if present is stripped from the metric name of
|
||||||
|
counters, and _total is now always a suffix on the sample
|
||||||
|
value. This means that all Counter samples now have a _total
|
||||||
|
suffix
|
||||||
|
+ The io.prometheus.client.Collector.Type enum's value UNTYPED
|
||||||
|
renamed to UNKNOWN
|
||||||
|
* Features:
|
||||||
|
+ Add Info and Enumeration metric types for direct
|
||||||
|
instrumentation
|
||||||
|
+ Counter, Summary, and Histogram metrics now expose a _created
|
||||||
|
sample with when their child was created
|
||||||
|
+ Add support for units
|
||||||
|
+ Add gauge histograms, info, stateset for custom collectors
|
||||||
|
+ Support negotiating and exposing OpenMetrics for all HTTP
|
||||||
|
server exposition
|
||||||
|
+ Add ability to filter metrics in DropwizardExports
|
||||||
|
+ Exemplars: API for adding OpenMetrics Exemplars and
|
||||||
|
out-of-the-box integration with OpenTelemetry tracing.
|
||||||
|
- Added patch:
|
||||||
|
* remove_opentelemetry_tracer.patch
|
||||||
|
+ remove dependency on opentelemetry
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Sep 19 11:10:30 UTC 2023 - Fridrich Strba <fstrba@suse.com>
|
Tue Sep 19 11:10:30 UTC 2023 - Fridrich Strba <fstrba@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package prometheus-simpleclient-java
|
# spec file for package prometheus-simpleclient-java
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -19,17 +19,19 @@
|
|||||||
%global version_id parent
|
%global version_id parent
|
||||||
%global upstream_name client_java
|
%global upstream_name client_java
|
||||||
Name: prometheus-simpleclient-java
|
Name: prometheus-simpleclient-java
|
||||||
Version: 0.8.0
|
Version: 0.16.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Prometheus Java Suite
|
Summary: Prometheus Java Suite
|
||||||
License: Apache-2.0 AND CC0-1.0
|
License: Apache-2.0 AND CC0-1.0
|
||||||
URL: https://github.com/prometheus/client_java/
|
URL: https://github.com/prometheus/client_java/
|
||||||
Source0: https://github.com/prometheus/client_java/archive/%{version_id}-%{version}.tar.gz
|
Source0: https://github.com/prometheus/client_java/archive/%{version_id}-%{version}.tar.gz
|
||||||
|
Patch1: remove_opentelemetry_tracer.patch
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: java-devel >= 1.8
|
|
||||||
BuildRequires: maven-local
|
BuildRequires: maven-local
|
||||||
BuildRequires: mvn(ch.qos.logback:logback-classic)
|
BuildRequires: mvn(ch.qos.logback:logback-classic)
|
||||||
|
BuildRequires: mvn(com.github.ben-manes.caffeine:caffeine) >= 2.7.0
|
||||||
BuildRequires: mvn(com.google.guava:guava)
|
BuildRequires: mvn(com.google.guava:guava)
|
||||||
|
BuildRequires: mvn(jakarta.servlet:jakarta.servlet-api)
|
||||||
BuildRequires: mvn(javax.servlet:javax.servlet-api)
|
BuildRequires: mvn(javax.servlet:javax.servlet-api)
|
||||||
BuildRequires: mvn(javax.xml.bind:jaxb-api)
|
BuildRequires: mvn(javax.xml.bind:jaxb-api)
|
||||||
BuildRequires: mvn(log4j:log4j)
|
BuildRequires: mvn(log4j:log4j)
|
||||||
@ -37,7 +39,6 @@ BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
|||||||
BuildRequires: mvn(org.apache.logging.log4j:log4j-core)
|
BuildRequires: mvn(org.apache.logging.log4j:log4j-core)
|
||||||
BuildRequires: mvn(org.eclipse.jetty:jetty-server)
|
BuildRequires: mvn(org.eclipse.jetty:jetty-server)
|
||||||
BuildRequires: mvn(org.eclipse.jetty:jetty-servlet)
|
BuildRequires: mvn(org.eclipse.jetty:jetty-servlet)
|
||||||
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -49,6 +50,18 @@ Summary: Prometheus Java Suite parent pom
|
|||||||
%description parent
|
%description parent
|
||||||
The Prometheus Java Suite: Client Metrics, Exposition, and Examples.
|
The Prometheus Java Suite: Client Metrics, Exposition, and Examples.
|
||||||
|
|
||||||
|
%package bom
|
||||||
|
Summary: Prometheus Java Simpleclient BOM
|
||||||
|
|
||||||
|
%description bom
|
||||||
|
Bill of Materials for the Simpleclient.
|
||||||
|
|
||||||
|
%package caffeine
|
||||||
|
Summary: Prometheus Java Simpleclient Caffeine
|
||||||
|
|
||||||
|
%description caffeine
|
||||||
|
Metrics collector for caffeine based caches.
|
||||||
|
|
||||||
%package common
|
%package common
|
||||||
Summary: Prometheus Java Simpleclient Common
|
Summary: Prometheus Java Simpleclient Common
|
||||||
|
|
||||||
@ -116,11 +129,35 @@ Summary: Prometheus Java Simpleclient Pushgateway
|
|||||||
Pushgateway exporter for the simpleclient.
|
Pushgateway exporter for the simpleclient.
|
||||||
|
|
||||||
%package servlet
|
%package servlet
|
||||||
Summary: Prometheus Java Simpleclient Servlet
|
Summary: Prometheus Java Simpleclient Servlet (javax)
|
||||||
|
|
||||||
%description servlet
|
%description servlet
|
||||||
|
HTTP servlet exporter for the simpleclient (Javax API).
|
||||||
|
|
||||||
|
%package servlet-common
|
||||||
|
Summary: Prometheus Java Simpleclient Servlet
|
||||||
|
|
||||||
|
%description servlet-common
|
||||||
HTTP servlet exporter for the simpleclient.
|
HTTP servlet exporter for the simpleclient.
|
||||||
|
|
||||||
|
%package servlet-jakarta
|
||||||
|
Summary: Prometheus Java Simpleclient Servlet (jakarta)
|
||||||
|
|
||||||
|
%description servlet-jakarta
|
||||||
|
HTTP servlet exporter for the simpleclient (Jakarta API).
|
||||||
|
|
||||||
|
%package tracer
|
||||||
|
Summary: Prometheus Java Span Context Supplier - Parent
|
||||||
|
|
||||||
|
%description tracer
|
||||||
|
Prometheus Java Span Context Supplier - Parent POM.
|
||||||
|
|
||||||
|
%package tracer-common
|
||||||
|
Summary: Prometheus Java Span Context Supplier - Common
|
||||||
|
|
||||||
|
%description tracer-common
|
||||||
|
Prometheus Java Span Context Supplier - Common.
|
||||||
|
|
||||||
%package javadoc
|
%package javadoc
|
||||||
Summary: Javadoc for %{name}
|
Summary: Javadoc for %{name}
|
||||||
|
|
||||||
@ -133,30 +170,38 @@ This package contains javadoc for %{name}.
|
|||||||
# Remove included jar files
|
# Remove included jar files
|
||||||
find . -name \*.jar -print0 | xargs -0 rm
|
find . -name \*.jar -print0 | xargs -0 rm
|
||||||
|
|
||||||
|
%pom_remove_plugin :maven-enforcer-plugin
|
||||||
%pom_remove_plugin :maven-release-plugin
|
%pom_remove_plugin :maven-release-plugin
|
||||||
%pom_remove_plugin :maven-deploy-plugin
|
%pom_remove_plugin :maven-deploy-plugin
|
||||||
%pom_remove_plugin :maven-javadoc-plugin
|
%pom_remove_plugin :maven-javadoc-plugin
|
||||||
|
%pom_remove_plugin :versions-maven-plugin
|
||||||
|
|
||||||
# Disable modules where we lack dependencies
|
for m in simpleclient_dropwizard \
|
||||||
for m in simpleclient_caffeine \
|
|
||||||
simpleclient_dropwizard \
|
|
||||||
simpleclient_hibernate \
|
simpleclient_hibernate \
|
||||||
simpleclient_spring_web \
|
simpleclient_spring_web \
|
||||||
simpleclient_spring_boot \
|
simpleclient_spring_boot \
|
||||||
simpleclient_vertx \
|
simpleclient_vertx \
|
||||||
benchmark; do
|
simpleclient_vertx4 \
|
||||||
|
integration_tests \
|
||||||
|
benchmarks; do
|
||||||
%pom_disable_module $m
|
%pom_disable_module $m
|
||||||
done
|
done
|
||||||
|
# Only build simpleclient_tracer_common as it's being used by an Examplar class
|
||||||
|
%pom_disable_module simpleclient_tracer_otel_agent simpleclient_tracer
|
||||||
|
%pom_disable_module simpleclient_tracer_otel simpleclient_tracer
|
||||||
|
|
||||||
%pom_add_dep javax.xml.bind:jaxb-api::provided simpleclient_pushgateway
|
# remove OpenTelemetry stuff, which we don't support
|
||||||
|
%patch -P1 -p2
|
||||||
|
%pom_remove_dep io.prometheus:simpleclient_tracer_otel simpleclient
|
||||||
|
%pom_remove_dep io.prometheus:simpleclient_tracer_otel_agent simpleclient
|
||||||
|
%pom_add_dep io.prometheus:simpleclient_tracer_common:%{version} simpleclient
|
||||||
|
|
||||||
%pom_xpath_set "pom:plugin[pom:artifactId[text()='maven-compiler-plugin']]/pom:configuration/pom:source" "1.8"
|
# Change compiler source/target version to JDK 8 level
|
||||||
%pom_xpath_set "pom:plugin[pom:artifactId[text()='maven-compiler-plugin']]/pom:configuration/pom:target" "1.8"
|
%pom_xpath_set "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-compiler-plugin']/pom:configuration/pom:source" "1.8" . simpleclient_hotspot
|
||||||
|
%pom_xpath_set "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-compiler-plugin']/pom:configuration/pom:target" "1.8" . simpleclient_hotspot
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{mvn_build} -f -s -- \
|
%{mvn_build} -f -s
|
||||||
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \
|
|
||||||
-Dsource=8
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%mvn_install
|
%mvn_install
|
||||||
@ -168,6 +213,10 @@ done
|
|||||||
|
|
||||||
%files parent -f .mfiles-parent
|
%files parent -f .mfiles-parent
|
||||||
|
|
||||||
|
%files bom -f .mfiles-simpleclient_bom
|
||||||
|
|
||||||
|
%files caffeine -f .mfiles-simpleclient_caffeine
|
||||||
|
|
||||||
%files common -f .mfiles-simpleclient_common
|
%files common -f .mfiles-simpleclient_common
|
||||||
|
|
||||||
%files graphite_bridge -f .mfiles-simpleclient_graphite_bridge
|
%files graphite_bridge -f .mfiles-simpleclient_graphite_bridge
|
||||||
@ -192,6 +241,14 @@ done
|
|||||||
|
|
||||||
%files servlet -f .mfiles-simpleclient_servlet
|
%files servlet -f .mfiles-simpleclient_servlet
|
||||||
|
|
||||||
|
%files servlet-common -f .mfiles-simpleclient_servlet_common
|
||||||
|
|
||||||
|
%files servlet-jakarta -f .mfiles-simpleclient_servlet_jakarta
|
||||||
|
|
||||||
|
%files tracer -f .mfiles-simpleclient_tracer
|
||||||
|
|
||||||
|
%files tracer-common -f .mfiles-simpleclient_tracer_common
|
||||||
|
|
||||||
%files javadoc -f .mfiles-javadoc
|
%files javadoc -f .mfiles-javadoc
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc NOTICE
|
%doc NOTICE
|
||||||
|
49
remove_opentelemetry_tracer.patch
Normal file
49
remove_opentelemetry_tracer.patch
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
diff --git a/client_java-parent-0.12.0/simpleclient/src/main/java/io/prometheus/client/exemplars/Tracer.java b/client_java-parent-0.12.0/simpleclient/src/main/java/io/prometheus/client/exemplars/Tracer.java
|
||||||
|
index 97ec4f4..0686268 100644
|
||||||
|
--- a/client_java-parent-0.12.0/simpleclient/src/main/java/io/prometheus/client/exemplars/Tracer.java
|
||||||
|
+++ b/client_java-parent-0.12.0/simpleclient/src/main/java/io/prometheus/client/exemplars/Tracer.java
|
||||||
|
@@ -1,44 +1,14 @@
|
||||||
|
package io.prometheus.client.exemplars;
|
||||||
|
|
||||||
|
-import io.prometheus.client.exemplars.tracer.common.SpanContextSupplier;
|
||||||
|
-import io.prometheus.client.exemplars.tracer.otel.OpenTelemetrySpanContextSupplier;
|
||||||
|
-import io.prometheus.client.exemplars.tracer.otel_agent.OpenTelemetryAgentSpanContextSupplier;
|
||||||
|
-
|
||||||
|
class Tracer {
|
||||||
|
|
||||||
|
ExemplarSampler initExemplarSampler() {
|
||||||
|
- try {
|
||||||
|
- Object spanContextSupplier = findSpanContextSupplier();
|
||||||
|
- if (spanContextSupplier != null) {
|
||||||
|
- return new DefaultExemplarSampler((SpanContextSupplier) spanContextSupplier);
|
||||||
|
- }
|
||||||
|
- } catch (NoClassDefFoundError ignored) {
|
||||||
|
- // simpleclient_tracer_common dependency not found
|
||||||
|
- }
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Avoid SpanContextSupplier in the method signature so that we can handle the NoClassDefFoundError
|
||||||
|
// even if the user excluded simpleclient_tracer_common from the classpath.
|
||||||
|
private Object findSpanContextSupplier() {
|
||||||
|
- try {
|
||||||
|
- if (OpenTelemetrySpanContextSupplier.isAvailable()) {
|
||||||
|
- return new OpenTelemetrySpanContextSupplier();
|
||||||
|
- }
|
||||||
|
- } catch (NoClassDefFoundError ignored) {
|
||||||
|
- // tracer_otel dependency not found
|
||||||
|
- } catch (UnsupportedClassVersionError ignored) {
|
||||||
|
- // OpenTelemetry requires Java 8, but client_java might run on Java 6.
|
||||||
|
- }
|
||||||
|
- try {
|
||||||
|
- if (OpenTelemetryAgentSpanContextSupplier.isAvailable()) {
|
||||||
|
- return new OpenTelemetryAgentSpanContextSupplier();
|
||||||
|
- }
|
||||||
|
- } catch (NoClassDefFoundError ignored) {
|
||||||
|
- // tracer_otel_agent dependency not found
|
||||||
|
- } catch (UnsupportedClassVersionError ignored) {
|
||||||
|
- // OpenTelemetry requires Java 8, but client_java might run on Java 6.
|
||||||
|
- }
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user