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

Remove prometheus-metrics-shaded-protobuf dependency from the agent #12564

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion javaagent-tooling/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ dependencies {
implementation("io.opentelemetry:opentelemetry-exporter-otlp")
implementation("io.opentelemetry:opentelemetry-exporter-logging-otlp")

implementation("io.opentelemetry:opentelemetry-exporter-prometheus")
implementation("io.opentelemetry:opentelemetry-exporter-prometheus") {
exclude(group = "io.prometheus", module = "prometheus-metrics-shaded-protobuf")
}
compileOnly("io.prometheus:prometheus-metrics-exposition-formats:1.3.1")
implementation("io.opentelemetry:opentelemetry-exporter-zipkin")

implementation("io.opentelemetry:opentelemetry-sdk-extension-jaeger-remote-sampler")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.prometheus.metrics.expositionformats;

import io.prometheus.metrics.model.snapshots.MetricSnapshots;
import java.io.IOException;
import java.io.OutputStream;

/**
* Replacement for prometheus protobuf writer that does not depend on any of the protobuf classes.
* This allows us to exclude io.prometheus:prometheus-metrics-shaded-protobuf dependency.
*
* @see <a
* href="https://github.com/prometheus/client_java/blob/main/prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriter.java">PrometheusProtobufWriter</a>
*/
public class PrometheusProtobufWriter implements ExpositionFormatWriter {

@Override
public boolean accepts(String acceptHeader) {
return false;
}

@Override
public void write(OutputStream out, MetricSnapshots metricSnapshots) throws IOException {
throw new UnsupportedOperationException();
}

@Override
public String getContentType() {
throw new UnsupportedOperationException();
}
}
47 changes: 22 additions & 25 deletions licenses/licenses.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading