ShowMerit

I Sold 200 Orders. My Dashboard Said 400.

Two monitoring agents counted the same 200 orders, so Splunk showed 400. Letting each Splunk OTel Collector agent read only its own Kubernetes node brought it back to 200, matching OpenTelemetry.

Rechecked 1 Dec 2026: works with python 3.12-slim and 3.15-slim (on a GitHub runner)

Abhimanyu BajajPublished 22 Nov 20264 min readTested in eu-central-1Lab codeLab evidence

Run this yourself

On your AWS account

The full lab with your own AWS account and Splunk token. Follow the steps in this article, then run its clean up step so nothing keeps running.

git clone https://github.com/Abhimanyu9988/showmerit.git
cd showmerit/labs/count-every-order-once-with-prometheus-and-opentelemetry

Picture a small café with two cashiers. A customer buys one coffee, and both cashiers ring it up. At closing time the till says two coffees were sold. The coffee machine knows better.

That happened in my lab. The café was a small online store, and the till was my monitoring dashboard.

Splunk Observability Cloud chart and data table: the Prometheus counter at 400 for the everywhere runs while OpenTelemetry's POST count is 200

200 orders, 400 on the dashboard

My little ordering app ran on Kubernetes across two servers, which Kubernetes calls nodes. Each copy of the app kept a tally of orders in Prometheus format, a common open way for apps to publish numbers. A Splunk OpenTelemetry Collector agent on each server read those tallies and sent them to Splunk for charts and alerts.

I sent 200 orders. All 200 succeeded. Splunk said 400.

Splunk data table for everywhere-1: four series of orders_created_total summing to 400, two per pod, told apart by host.id, host.name and availability zone

The app also reported its successful orders through OpenTelemetry, and that said 200. Here the two numbers match by design, because the tally goes up once per successful order. In other apps they can differ.

Splunk held two lines of data for each copy of the app, one per server. Both agents were reading both copies. Two cashiers, one coffee.

Why it matters

Nothing was broken. Every customer got one order. But the dashboard showed double the sales, and an alert on that number would fire at the wrong time. Splunk and OpenTelemetry did what I asked. My instruction, "every agent, read every app", was the problem.

The fix

Before and after: with a cluster-wide scrape job both agents scrape both orders pods and Splunk shows 400 over 4 series; scoped to the agent's node, each pod has one scraper and Splunk shows 200 over 2 series; OpenTelemetry shows 200 in both

Each copy of an app lives on one server, so I told each agent to read only the apps on its own server. Two ways worked: one extra rule in my own scrape job (a node field selector), or the agent's built-in Prometheus autodetection, which already stays on its own server.

Back to 200 in every fixed run, six runs in all:

Run Agent-app pairs Prometheus counter in Splunk Lines of data (most per app) OpenTelemetry count
everywhere-1 4 400 4 (2) 200
everywhere-2 4 400 4 (2) 200
node-1 2 200 2 (1) 200
node-2 2 200 2 (1) 200
autodetect-1 2 200 2 (1) 200
autodetect-2 2 200 2 (1) 200

Splunk data table: the autodetect runs at 200 for both the Prometheus counter and OpenTelemetry's POST count

Next time a number drives a decision, I'll ask first: who is counting this, and how many of them are there?

Try it yourself

You need an AWS account and a Splunk Observability Cloud account. The lab code and the raw output of all six runs are in the evidence folder.

The two fixes, as chart values. The node field selector on your own scrape job (the chart sets K8S_NODE_NAME on every agent):

kubernetes_sd_configs:
  - role: pod
    namespaces:
      names: [demo]
    selectors:
      - role: pod
        field: spec.nodeName=${env:K8S_NODE_NAME}

Or autodetection, which scrapes pods annotated prometheus.io/scrape: "true" from their own node:

autodetect:
  prometheus: true

Step 1: Create the cluster (EKS took 7m8s in my run, on two t3.large nodes)

git clone https://github.com/Abhimanyu9988/showmerit.git
cd showmerit/labs/count-every-order-once-with-prometheus-and-opentelemetry
export AWS_REGION=eu-central-1 LAB_NAME=prom-lab TF_VAR_lab_name=prom-lab
export SPLUNK_REALM=us1 SPLUNK_ACCESS_TOKEN=your-ingest-token SPLUNK_API_TOKEN=your-api-token
terraform init && terraform apply -auto-approve

You get EKS 1.34 with two t3.large nodes. The app is one Flask service with prometheus-client 0.26.0 and zero-code OpenTelemetry 0.66b2, as orders-a on one node and orders-b on the other.

Step 2: The cluster-wide scrape job (333 s in my run)

Run ./reproduce.sh. It installs the Splunk OTel Collector chart 0.163.1 with values-everywhere.yaml, deploys both pods, runs everywhere-1 and everywhere-2 (20 s at 10 orders a second each) and reads everywhere-1 back from Splunk.

Step 3: The two node-scoped configs (601 s in my run)

Run ./fix.sh. It switches the agents to values-node.yaml, then values-autodetect.yaml, two runs each, and reads all six runs back from Splunk. Before each switch it stops the last run's pods, so no run is scraped under two configs.

Clean up (the cluster costs money while it runs)

./cleanup.sh
terraform destroy -auto-approve

What I didn't test

Sources

Disclosure: I work at Splunk, part of Cisco. This is my personal blog; the post isn't sponsored or reviewed by my employer.


I built this in a disposable AWS lab. The lab code and raw output are in the repo. Drafted with AI assistance and reviewed by me.

Read next

OpenTelemetry code owner for two Collector components. Writes hands-on AWS container guides, each tested in a lab. See the proof