Wire a service's OpenTelemetry output to Sematext Cloud. Walks through region, App-type, instrumentation flow (managed OTLP endpoint vs Sematext Agent), and signal selection (traces/metrics/logs), then produces the exact env-var block and points at a runnable reference example in this repo. Invoke when instrumenting a new app for Sematext.
74
92%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Risky
Do not use without reviewing
Use this skill to wire a service that emits OpenTelemetry data into Sematext Cloud. The skill is parameter-driven: ask the user the questions in the Triage section, then assemble the env-var block from the matrices below and point them at the matching reference example in this repo.
Ask the user, in order:
otlp-receiver.sematext.com (or EU). Simpler. Default for new users.http/protobuf). gRPC only if the user has a specific reason.One token per App. Each Tracing / Logs / Monitoring App you create in Sematext Cloud has its own apiKey-style token. You wire them as separate signal-specific headers — the OTel exporter sends each signal to whichever App's token is set, and skips signals with no header.
Custom auth header. Sematext uses X-API-TOKEN=<token>, not the standard Authorization: Bearer …. Some hand-coded OTLP exporters assume Bearer; those need overriding. The env-var path below works uniformly across language SDKs.
Region matters. Different OTLP endpoint hostnames for US vs EU. The token also belongs to one region; using a US token against the EU endpoint will silently drop data.
| Region | Protocol | OTEL_EXPORTER_OTLP_ENDPOINT | OTEL_EXPORTER_OTLP_PROTOCOL |
|---|---|---|---|
| US | HTTP (default) | https://otlp-receiver.sematext.com | http/protobuf |
| US | gRPC | https://otlp-receiver-grpc.sematext.com:443 | grpc |
| EU | HTTP (default) | https://otlp-receiver.eu.sematext.com | http/protobuf |
| EU | gRPC | https://otlp-receiver-grpc.eu.sematext.com:443 | grpc |
Set the headers only for the signals the user is wiring up. Each <token> is the token of the corresponding Sematext App.
# Endpoint + protocol — pick one row from the matrix above
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-receiver.sematext.com
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# Per-signal token. Omit a line if the user doesn't have that App type.
export OTEL_EXPORTER_OTLP_TRACES_HEADERS=X-API-TOKEN=<tracing-app-token>
export OTEL_EXPORTER_OTLP_LOGS_HEADERS=X-API-TOKEN=<logs-app-token>
export OTEL_EXPORTER_OTLP_METRICS_HEADERS=X-API-TOKEN=<monitoring-app-token>
# Resource attributes — service.name is what shows up in the UI
export OTEL_SERVICE_NAME=my-service
export OTEL_SERVICE_VERSION=1.0.0If the user is on auto-instrumentation, this env block plus the SDK's auto-instrumentation hook is all they need. If manual, they additionally need the SDK init code from the reference example.
The service ships to the locally-running Sematext Agent, which forwards to Sematext Cloud. No token in the service config — the agent already has one.
| Signal | Port |
|---|---|
| Traces | 4338 |
| Metrics | 4318 |
| Logs | 4328 (manual instrumentation only) |
These are signal-specific, so the umbrella OTEL_EXPORTER_OTLP_ENDPOINT is not used here — the per-signal OTEL_EXPORTER_OTLP_*_ENDPOINT env vars are.
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4338
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://localhost:4328 # manual only
export OTEL_SERVICE_NAME=my-service
export OTEL_SERVICE_VERSION=1.0.0Agent enabling commands (run once per signal type the user wants):
sudo /opt/spm/spm-monitor/bin/st-agent otel enable --type traces
sudo /opt/spm/spm-monitor/bin/st-agent otel enable --type metrics
sudo /opt/spm/spm-monitor/bin/st-agent otel enable --type logsSee Sematext Agent OpenTelemetry docs for install and enable details.
Once the user has picked language + env + instrumentation, send them to the corresponding directory. The READMEs there have language-specific build and run commands.
Each language directory has the same structure:
{lang}/
├── README.md
├── baremetal/
│ ├── auto-instrumentation/{framework}/
│ └── manual-instrumentation/{framework}/
├── docker/
│ ├── auto-instrumentation/{framework}/
│ └── manual-instrumentation/{framework}/
└── kubernetes/
├── auto-instrumentation/{framework}/
└── manual-instrumentation/{framework}/The per-language examples target the Sematext Agent flow. If the user picked the managed OTLP flow instead, the SDK init code is identical — only the endpoint + auth headers differ (follow the env-var block in Flow A above).
| Stack | Path | Flow |
|---|---|---|
| React + Express | e2e/react-express/ | Managed OTLP endpoint (via backend-as-proxy for the browser-side spans) |
The e2e example is the natural reference for any setup that includes browser-side OpenTelemetry — browsers can't ship OTLP directly to a remote receiver (CORS), so the frontend POSTs spans to a same-origin endpoint on its own backend, which forwards to Sematext.
Within 60 seconds of starting the instrumented service:
| Signal | Where to look |
|---|---|
| Traces | Tracing App → Services → look for the service.name you set |
| Metrics | Monitoring App → look for the OTel metric names emitted by your SDK |
| Logs | Logs App → filter by service.name |
If nothing arrives, see Troubleshooting below.
| Symptom | Likely cause |
|---|---|
| No data in any App within 60s | Token mismatch (region mismatch counts here too — US token on EU endpoint silently fails) |
| Traces but no metrics | Auto-instrumentation doesn't enable metrics in all SDKs by default; check SDK-specific flag |
| Auto-instrumented but no logs | Expected — auto only covers traces + metrics. Switch to manual for logs. |
Connection refused on agent ports | Agent not running, or st-agent otel enable --type <signal> not run for that signal |
Connection refused on managed endpoint | Wrong protocol (gRPC URL with HTTP protocol setting or vice versa) |
| Traces dropped intermittently | Batch size or queue full — bump OTEL_BSP_MAX_QUEUE_SIZE |
| TLS errors against managed endpoint | Old SDK / system CA bundle missing — update OS certs or SDK |
X-API-TOKEN header rejected | Hand-coded exporter that forces Authorization: Bearer; remove that and use the OTEL_EXPORTER_OTLP_*_HEADERS env var path instead |
| CORS errors (browser/RUM) | Managed OTLP endpoint is server-to-server; browser-side instrumentation needs a different surface |
traceId / spanId are emitted with each log record (manual instrumentation gives full control over this).32e5fcb
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.