Skip to content

SigNoz/kong-plugin-signoz

Repository files navigation

kong-plugin-signoz

Kong Gateway plugin that ships OTLP traces and logs from Kong to SigNoz.

Supports Kong Gateway 3.6+ (open-source and Enterprise). Delegates trace export to Kong's bundled OpenTelemetry plugin and synthesises one structured OTLP log record per request alongside.

Install

luarocks install kong-plugin-signoz

Add signoz to the loaded plugins (kong.conf or env):

plugins = bundled,signoz

Restart Kong, then enable the plugin against your gateway, service, route, or consumer.

Getting Started

Install the plugin, enable Kong's tracer, and ship the first request to SigNoz.

1. Install the plugin

The plugin's Lua sources need to be on every Kong node's filesystem. Pick the route that matches your deployment — Kong's installation and distribution guide covers each in depth.

LuaRocks (host install)

luarocks install kong-plugin-signoz

Load it

After installing, add signoz to the loaded plugins in kong.conf (or via the KONG_PLUGINS environment variable) on every node:

plugins = bundled,signoz

2. Enable Kong's tracer

The plugin enriches Kong's root request span before export. Kong's tracer must be on for that span to exist. Set in kong.conf or via environment (see Kong's tracing reference for the full list of values):

tracing_instrumentations = all
tracing_sampling_rate    = 1.0

Without these, ngx.ctx.KONG_SPANS stays empty and no spans are exported. Logs still ship; only the trace path is gated on the tracer being on.

Restart Kong to pick up both the new plugin and the tracer settings.

3. Get your ingestion endpoint and key

SigNoz Cloud: find both under Settings > Ingestion. See Ingestion Keys.

Self-hosted: point exporter.endpoint at your OTel collector's OTLP/HTTP port (default 4318). No key required.

4. Enable the plugin

Globally on the gateway (Cloud example):

curl -X POST http://localhost:8001/plugins \
  --data "name=signoz" \
  --data "config.exporter.endpoint=https://ingest.<region>.signoz.cloud:443" \
  --data "config.exporter.key=<your-ingestion-key>" \
  --data "config.resource.service_name=kong" \
  --data "config.resource.deployment_environment=production" \
  --data "config.logs.instrumentations=access"

Self-hosted equivalent:

curl -X POST http://localhost:8001/plugins \
  --data "name=signoz" \
  --data "config.exporter.endpoint=http://signoz-otel-collector:4318" \
  --data "config.resource.service_name=kong" \
  --data "config.logs.instrumentations=access"

The plugin can also be scoped per-service, per-route, or per-consumer using the standard Kong Admin API. See Kong's Plugin entity docs for scoping syntax.

5. Verify

Send a request through Kong:

curl -i http://localhost:8000/<your-route>

In SigNoz:

  • Services view shows kong with traffic.
  • Traces Explorer lists spans named kong with attributes kong.service.name, kong.route.name, and HTTP semconv fields.
  • Logs Explorer lists one record per request with body shaped "<METHOD> <path> <status> <duration>ms" and severity coloured by status class.

If nothing arrives within ~5 seconds, check Kong's error log for [signoz] entries — exporter HTTP errors and queue drops are logged there.

What's next

  • Reference for understanding every field, default, and behaviour.
  • Ingestion overview for checking out endpoints by region, auth headers

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors