...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "gateway": { "clusterid": 0, "segmentid": 0, "environmentid": 0, "group": "default", "iothreads": 4, "workerthreads": 20, "http2": true, "max.entity.size": 67107840, "max.header.size": -1, "idle.timeout": -1, "norequest.timeout": -1, "request.parse.timeout": -1, "max.parameters": -1, "max.headers": -1, "max.cookies": -1, "max.buffered.request.size": -1, "always.add.date.header": true, "sslaccelerator": { "address": "10.1.2.3", "header.client.ip": "X-Forwarded-For", "header.client.port": "X-Forwarded-Port", "header.secure": "X-SSL-Cipher", "header.client.certificate": "X-Client-Cert" }, "accesslog.pattern": "%{REMOTE_ADDR}(:%{REMOTE_PORT}) - "%{REMOTE_USER}" %{TIME_LOGFORMAT} "%{ORIGINAL_REQUEST}" %{HTTP_RESPONSECODE} %{HTTP_BYTESSENT} %{HTTP_RESPONSETIME} "%{HTTP_REFERER}", "accesslog.type": "log", "accesslog.category": "accesslog", "accesslog.directory": "/var/log", "accesslog.basename": "accesslog", "accesslog.suffix": "log", "dynatraceopentelemetry.webserver.nameenabled": "Ceptor"false, "dynatraceopentelemetry.application.idrequestmapper": "Ceptor Gateway%{REQUEST_PATH}", "dynatraceopentelemetry.context.rootheaders": "/^authorization", "errorpage": "%{script}getBody();\n\nfunction getBody() {\n var Headers = Java.type('io.undertow.util.Headers');\n var HtmlEncoder = Java.type('dk.itp.security.utils.HtmlEncoder');\n \n var errorInfo = JSON.parse(input);\n \n var reqHeaders = context.httpExchange.getRequestHeaders();\n if (reqHeaders.getFirst('Content-Type') == 'application/json' ||\n reqHeaders.getFirst('Accept').contains('application/json')) {\n context.httpExchange.getResponseHeaders().add(Headers.CONTENT_TYPE, 'application/json')\n \n var resp = {\n 'status': errorInfo.status,\n 'error': errorInfo.message\n // ,'diagnostics': errorInfo.exception\n }\n \n return JSON.stringify(resp);\n }\n \n context.httpExchange.getResponseHeaders().add(Headers.CONTENT_TYPE, 'text/html')\n \n return \"<html><head><title>Error \" + errorInfo.status + \"<\/title><\/head><body>Error \" +\n errorInfo.status + \" \" + errorInfo.message +\n// \"<pre>\" + HtmlEncoder.encode(errorInfo.exception) + \"<\/pre>\" +\n \"<\/body><\/html>\"\n}" } } |
...
Here, you can specify the following settings:
General
Contains general settings for the entire gateway
JSON object key is gateway
...
Default is log
JSON key is accesslog.suffix
...
OpenTelemetry
These settings affect the Dynatrace OpenTelemetry integration.
Note |
---|
This requires minimum Ceptor 6.5.010 |
Webserver name
Name of web server, presented to Dynatrace
Default is Ceptor
JSON key is dynatrace.webserver.name
Application ID
Application ID, presented to Dynatrace
Default is Ceptor Gateway
JSON key is dynatrace.application.id
Context root
Context root, presented to Dynatrace
...
Enable OpenTelemetry
Enable OpenTelemetry support - if set, OpenTelemetry API is called for incoming and outgoing requests.
Tip |
---|
Note that if you use OpenTelemetry Agent, you should disable automatic Undertow instrumentation, since the default instrumentation is inferior and does not provide full information we cannot rely on it so disabling default is needed to avoid double entries. Also note that if you use Dynatrace, then you need to go into settings, and choose Server-side service monitoring → Span context propagation and here add an item with the matcher "Span equals client" otherwise context propagation will not work. Details in the screenshot below |
Default is false
JSON key is opentelemetry.enabled
Request Path
When creating traces, this mapper controls what text to use - it can be use to replace e.g. individual path entries with "Images", "Javascript" or other types or you can choose to otherwise override or shorten the path.
By default the full path will be provided
Default is %{REQUEST_PATH}
JSON key is opentelemetry.requestpathmapper
HTTP Headers
Chooses which HTTP (request or response) headers to included in the trace taken
Default is ^authorization - meaning everything except for the authorization header.
JSON key is opentelemetry.headers