feat: update Pyroscope endpoints and documentation for improved profiling integration

This commit is contained in:
Nawaz Dhandala
2026-03-31 22:50:13 +01:00
parent e3ca08c69f
commit 63dd84339e
5 changed files with 18 additions and 20 deletions

View File

@@ -1114,7 +1114,7 @@ const TelemetryDocumentation: FunctionComponent<ComponentProps> = (
? `${httpProtocol}://${HOST}/otlp`
: "<YOUR_ONEUPTIME_URL>";
const pyroscopeUrl: string = HOST
? `${httpProtocol}://${HOST}`
? `${httpProtocol}://${HOST}/pyroscope`
: "<YOUR_ONEUPTIME_PYROSCOPE_URL>";
// Fetch ingestion keys on mount

View File

@@ -72,7 +72,7 @@ pyroscope.ebpf "default" {
pyroscope.write "oneuptime" {
endpoint {
url = "https://oneuptime.com"
url = "https://oneuptime.com/pyroscope"
headers = {
"x-oneuptime-token" = "YOUR_ONEUPTIME_SERVICE_TOKEN",
}

View File

@@ -50,7 +50,7 @@ export default class Profiling {
/*
* Use the OTLP endpoint base URL as the Pyroscope server address.
* The Pyroscope SDK will append /ingest to this URL.
* The Telemetry service has a Pyroscope-compatible /ingest endpoint.
* The final URL will be /pyroscope/ingest, routed by nginx to the telemetry service.
*/
const endpoint: string | undefined =
process.env["OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT"];
@@ -59,7 +59,8 @@ export default class Profiling {
return undefined;
}
// Strip /otlp suffix if present, since Pyroscope SDK appends /ingest
// Strip /otlp suffix if present and append /pyroscope
// The Pyroscope SDK appends /ingest, so the final URL will be /pyroscope/ingest
let baseUrl: string = endpoint;
if (baseUrl.endsWith("/otlp")) {
baseUrl = baseUrl.substring(0, baseUrl.length - 5);
@@ -68,7 +69,7 @@ export default class Profiling {
baseUrl = baseUrl.substring(0, baseUrl.length - 1);
}
return baseUrl;
return `${baseUrl}/pyroscope`;
}
private static getAuthToken(): string | undefined {

View File

@@ -559,6 +559,18 @@ ${PROVISION_SSL_CERTIFICATE_KEY_DIRECTIVE}
proxy_pass $backend_telemetry;
}
# Pyroscope profiling ingestion endpoint
location /pyroscope {
resolver ${NGINX_RESOLVER} valid=30s;
set $backend_telemetry http://${SERVER_TELEMETRY_HOSTNAME}:${TELEMETRY_PORT};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass $backend_telemetry;
}
location ~ /opentelemetry.proto.collector* {
resolver ${NGINX_RESOLVER} valid=30s;
set $backend_otel_grpc grpc://${SERVER_TELEMETRY_HOSTNAME}:4317;

View File

@@ -59,20 +59,5 @@ router.post(
},
);
// Also mount at /ingest for Pyroscope SDKs that use serverAddress without a subpath
router.post(
"/ingest",
MultipartFormDataMiddleware,
mapBearerTokenMiddleware,
setProfilesProductType,
TelemetryIngest.isAuthorizedServiceMiddleware,
async (
req: ExpressRequest,
res: ExpressResponse,
next: NextFunction,
): Promise<void> => {
return PyroscopeIngestService.ingestPyroscopeProfile(req, res, next);
},
);
export default router;