Skip to content

fix(otel): report API APM service as shopmon-api - #797

Draft
shyim wants to merge 1 commit into
mainfrom
cursor/otel-api-service-name-ffd8
Draft

fix(otel): report API APM service as shopmon-api#797
shyim wants to merge 1 commit into
mainfrom
cursor/otel-api-service-name-ffd8

Conversation

@shyim

@shyim shyim commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

The HTTP API currently reports OpenTelemetry/Datadog APM spans under service shopmon, while the worker already uses shopmon-worker. Ops/docs commonly expect the API as shopmon-api.

This change makes the API append -api to the shared base OTEL_SERVICE_NAME, matching the worker’s existing -worker suffix. Server and worker already share one ConfigMap/env in-repo (k8s/preview), so treating OTEL_SERVICE_NAME as a base name (default shopmon) is the least surprising approach:

Process Before After
API (shopmon server) shopmon shopmon-api
Worker (shopmon worker) shopmon-worker shopmon-worker (unchanged)

OTEL_SERVICE_NAME remains the override lever for the base; docs in .env.example and SELF_HOSTING.md spell out the suffixes.

Why not change the env default to shopmon-api?

Setting OTEL_SERVICE_NAME=shopmon-api while the worker still does base + "-worker" would produce shopmon-api-worker. In-repo deploy manifests do not set a dedicated API-only service name.

Datadog migration note

This creates a new APM service (shopmon-api). Existing dashboards/monitors keyed on service:shopmon will stop seeing API traffic until updated.

Confirmed in Datadog today:

  • Service catalog: shopmon, shopmon-worker (no shopmon-api yet)
  • Dashboard Shopmon Overview widgets filter service:shopmon for HTTP metrics and list template values shopmon / shopmon-worker
  • Existing shopmon monitors found via search are synthetics/infra, not APM service:shopmon queries — still re-check any saved views/notebooks

Before/after deploy checklist

  1. Update dashboard/monitor queries from service:shopmonservice:shopmon-api (worker stays service:shopmon-worker)
  2. Optionally keep a temporary dual filter (service:(shopmon OR shopmon-api)) during rollout
  3. After traffic moves, retire the old shopmon service references

In-repo service:shopmon grep

No in-repo hits for service:shopmon (monitors/dashboards live in Datadog, not this repo).

Test plan

  • Config default still OTEL_SERVICE_NAME=shopmon
  • mise run lint
  • mise run test
Open in Web Open in Cursor 

Align the HTTP server with the worker's process suffix pattern so
OTEL_SERVICE_NAME stays a shared base (shopmon) while the API reports
as shopmon-api and the worker remains shopmon-worker.

Co-authored-by: Soner <github@shyim.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants