API、CLI 与扩展
Settings Otel
Operations about OpenTelemetry settings
Retrieve the OpenTelemetry configuration
Retrieve the current OpenTelemetry configuration, including every field exposed in the UI. Requires the \
otel:manage\scope.
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"SettingsOtel","description":"Operations about OpenTelemetry settings"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"otel-settings":{"type":"object","additionalProperties":false,"description":"The OpenTelemetry configuration, matching the fields exposed in the UI. On a write this is a full replacement: every field must be provided. Fields managed declaratively via environment variables are returned with their effective value and ignored on write.\n","required":["enabled","exporterEndpoint","exporterTracingPath","exporterServiceName","exporterHeaders","tracesSampleRate","startupConnectivityTimeoutMs","includeNodeSpans","injectOutbound","productionExecutionsOnly"],"properties":{"enabled":{"type":"boolean","description":"Whether OpenTelemetry tracing is enabled."},"exporterEndpoint":{"type":"string","format":"uri","description":"The base URL of the OTLP collector to export traces to."},"exporterTracingPath":{"type":"string","description":"The path appended to the endpoint for the OTLP traces signal."},"exporterServiceName":{"type":"string","minLength":1,"description":"The `service.name` resource attribute reported on every span."},"exporterHeaders":{"type":"string","description":"Additional headers sent to the OTLP collector, as a single string of comma-separated `key=value` pairs (e.g. `authorization=Bearer my-token,x-tenant-id=acme`). Whitespace around each key and value is trimmed; a value may contain spaces but not commas. Use an empty string when unused.\n"},"tracesSampleRate":{"type":"number","minimum":0,"maximum":1,"description":"The ratio of traces to sample, between 0 (none) and 1 (all)."},"startupConnectivityTimeoutMs":{"type":"integer","minimum":0,"description":"How long, in milliseconds, to wait when checking the collector is reachable. Also used as the timeout for the test-trace endpoint.\n"},"includeNodeSpans":{"type":"boolean","description":"Whether to emit a span for each node execution in addition to the workflow span."},"injectOutbound":{"type":"boolean","description":"Whether to inject trace context headers into outbound HTTP requests made by nodes."},"productionExecutionsOnly":{"type":"boolean","description":"When true, only production executions of published (active) workflows are traced, not manual/test runs.\n"}}}},"responses":{"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"}}},"paths":{"/settings/otel":{"get":{"tags":["SettingsOtel"],"summary":"Retrieve the OpenTelemetry configuration","description":"Retrieve the current OpenTelemetry configuration, including every field exposed in the UI. Requires the `otel:manage` scope.\n","responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/otel-settings"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"}}}}}}Set the OpenTelemetry configuration
Set the OpenTelemetry configuration. This is a full replacement: every field must be provided, and a partial body is rejected. The update takes effect exactly as it would from the UI, using the same validation, and is applied to the running instance immediately. Fields managed declaratively via environment variables are read-only: attempting to change one is rejected with 409, while re-submitting its current value (as returned by GET) is accepted. Requires the \
otel:manage\scope.
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"SettingsOtel","description":"Operations about OpenTelemetry settings"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"otel-settings":{"type":"object","additionalProperties":false,"description":"The OpenTelemetry configuration, matching the fields exposed in the UI. On a write this is a full replacement: every field must be provided. Fields managed declaratively via environment variables are returned with their effective value and ignored on write.\n","required":["enabled","exporterEndpoint","exporterTracingPath","exporterServiceName","exporterHeaders","tracesSampleRate","startupConnectivityTimeoutMs","includeNodeSpans","injectOutbound","productionExecutionsOnly"],"properties":{"enabled":{"type":"boolean","description":"Whether OpenTelemetry tracing is enabled."},"exporterEndpoint":{"type":"string","format":"uri","description":"The base URL of the OTLP collector to export traces to."},"exporterTracingPath":{"type":"string","description":"The path appended to the endpoint for the OTLP traces signal."},"exporterServiceName":{"type":"string","minLength":1,"description":"The `service.name` resource attribute reported on every span."},"exporterHeaders":{"type":"string","description":"Additional headers sent to the OTLP collector, as a single string of comma-separated `key=value` pairs (e.g. `authorization=Bearer my-token,x-tenant-id=acme`). Whitespace around each key and value is trimmed; a value may contain spaces but not commas. Use an empty string when unused.\n"},"tracesSampleRate":{"type":"number","minimum":0,"maximum":1,"description":"The ratio of traces to sample, between 0 (none) and 1 (all)."},"startupConnectivityTimeoutMs":{"type":"integer","minimum":0,"description":"How long, in milliseconds, to wait when checking the collector is reachable. Also used as the timeout for the test-trace endpoint.\n"},"includeNodeSpans":{"type":"boolean","description":"Whether to emit a span for each node execution in addition to the workflow span."},"injectOutbound":{"type":"boolean","description":"Whether to inject trace context headers into outbound HTTP requests made by nodes."},"productionExecutionsOnly":{"type":"boolean","description":"When true, only production executions of published (active) workflows are traced, not manual/test runs.\n"}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"conflict":{"description":"Conflict"}}},"paths":{"/settings/otel":{"put":{"tags":["SettingsOtel"],"summary":"Set the OpenTelemetry configuration","description":"Set the OpenTelemetry configuration. This is a full replacement: every field must be provided, and a partial body is rejected. The update takes effect exactly as it would from the UI, using the same validation, and is applied to the running instance immediately. Fields managed declaratively via environment variables are read-only: attempting to change one is rejected with 409, while re-submitting its current value (as returned by GET) is accepted. Requires the `otel:manage` scope.\n","requestBody":{"description":"The OpenTelemetry configuration to set.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/otel-settings"}}}},"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/otel-settings"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"409":{"$ref":"#/components/responses/conflict"}}}}}}Test the connection to an OTLP collector
Send a single test span to the given OTLP collector and report whether it was accepted. This tests the supplied connection details without changing the stored configuration. Fields managed declaratively via environment variables are overridden with their effective value before the test is sent. Requires the \
otel:manage\scope.
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"SettingsOtel","description":"Operations about OpenTelemetry settings"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"otel-test-trace":{"type":"object","additionalProperties":false,"description":"The connection details to test against an OTLP collector. Fields managed declaratively via environment variables are overridden with their effective value before the test is sent.\n","required":["exporterEndpoint","exporterTracingPath","exporterServiceName","exporterHeaders","startupConnectivityTimeoutMs"],"properties":{"exporterEndpoint":{"type":"string","format":"uri","description":"The base URL of the OTLP collector to export traces to."},"exporterTracingPath":{"type":"string","description":"The path appended to the endpoint for the OTLP traces signal."},"exporterServiceName":{"type":"string","minLength":1,"description":"The `service.name` resource attribute reported on the test span."},"exporterHeaders":{"type":"string","description":"Additional headers sent to the OTLP collector, as a single string of comma-separated `key=value` pairs (e.g. `authorization=Bearer my-token,x-tenant-id=acme`). Whitespace around each key and value is trimmed; a value may contain spaces but not commas. Use an empty string when unused.\n"},"startupConnectivityTimeoutMs":{"type":"integer","minimum":0,"description":"How long, in milliseconds, to wait for the collector to respond."}}},"otel-test-trace-result":{"type":"object","additionalProperties":false,"description":"The outcome of the test connection to the OTLP collector.","required":["success"],"properties":{"success":{"type":"boolean","description":"Whether the test span was accepted by the collector."},"error":{"type":"string","description":"The error reported by the collector or exporter. Present only when `success` is false.\n"}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"}}},"paths":{"/settings/otel/test-trace":{"post":{"tags":["SettingsOtel"],"summary":"Test the connection to an OTLP collector","description":"Send a single test span to the given OTLP collector and report whether it was accepted. This tests the supplied connection details without changing the stored configuration. Fields managed declaratively via environment variables are overridden with their effective value before the test is sent. Requires the `otel:manage` scope.\n","requestBody":{"description":"The connection details to test.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/otel-test-trace"}}}},"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/otel-test-trace-result"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"}}}}}}官方原文和授权
本页来自 N8N 英文官方网站固定快照,并转换成 xueai 静态页面。内容以 N8N 持续更新的官方页面为准。