mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat: update Pyroscope endpoints and documentation for improved profiling integration
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user