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

fix: send sampleRate url param only when needed #134

Merged
Merged
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.pyroscope.javaagent.impl;

import io.pyroscope.http.Format;
import io.pyroscope.javaagent.EventType;
import io.pyroscope.javaagent.Snapshot;
import io.pyroscope.javaagent.api.Exporter;
import io.pyroscope.javaagent.api.Logger;
Expand Down Expand Up @@ -147,10 +148,11 @@ private HttpUrl urlForSnapshot(final Snapshot snapshot) {
.addQueryParameter("name", nameWithStaticLabels())
.addQueryParameter("units", snapshot.eventType.units.id)
.addQueryParameter("aggregationType", snapshot.eventType.aggregationType.id)
.addQueryParameter("sampleRate", Long.toString(config.profilingIntervalInHertz()))
.addQueryParameter("from", Long.toString(started.getEpochSecond()))
.addQueryParameter("until", Long.toString(finished.getEpochSecond()))
.addQueryParameter("spyName", Config.DEFAULT_SPY_NAME);
if (EventType.CPU == snapshot.eventType || EventType.ITIMER == snapshot.eventType || EventType.WALL == snapshot.eventType)
builder.addQueryParameter("sampleRate", Long.toString(config.profilingIntervalInHertz()));
if (config.format == Format.JFR)
builder.addQueryParameter("format", "jfr");
return builder.build();
Expand Down
Loading