On this page
What you get
Graphwake learns which of your services call which endpoints of your other services, and how often. When a team confirms a calling service, every endpoint it uses becomes a subscription of that team.
Optional. Without it, Graphwake still needs only your spec.
Before you start
- APM tracing for the calling services, and an API key and an application key with the APM read permission.
- A Graphwake workspace on Pro or Enterprise, and an Admin to add the usage source.
- The Graphwake agent, which is open source: a binary from its releases on the machine where you try the steps below, or Docker to run its image
ghcr.io/graphwake/agent:0.3.0. - A place to run a daily job with Docker and
curl, such as GitHub Actions or Azure Pipelines, with the two keys as secrets.
Step 1: add a usage source
- In Graphwake, open Settings → Integrations → Usage sources and choose Add a source.
- Copy the usage key. It is shown once. Store it as a secret named
GRAPHWAKE_USAGE_KEYin the pipeline that will run the step.
Step 2: export the calls
graphwake usage query --source datadog prints a call to Datadog's spans API that counts the client spans of one calling service over the last 7 days, by host, path and method. Set DD_API_KEY and DD_APP_KEY, and DD_SITE if your Datadog site is not datadoghq.com. Start from an empty file (rm -f datadog-usage.json), then replace orders with a calling service and run the call once for each; every answer is appended to datadog-usage.json.
# Datadog APM: count outgoing HTTP calls of one service, last 7 days.
# Run once per calling service (replace orders); append every answer to one file.
curl -s -w '\n' -X POST "https://api.${DD_SITE:-datadoghq.com}/api/v2/spans/analytics/aggregate" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d '{"data":{"type":"aggregate_request","attributes":{
"filter":{"from":"now-7d","to":"now","query":"service:orders @span.kind:client"},
"compute":[{"aggregation":"count","type":"total"}],
"group_by":[{"facet":"service","limit":1},
{"facet":"@http.url_details.host","limit":20},
{"facet":"@http.url_details.path","limit":100},
{"facet":"@http.method","limit":5}]}}}' >> datadog-usage.jsongraphwake usage query --source datadog prints.Step 3: read what would be sent
Run the step with --dry-run. It uses the usage key to ask Graphwake for your endpoint list, prints the summary it would send and what is not sent, and sends no summary. In CI its output is the job log.
export GRAPHWAKE_USAGE_KEY=<your usage key>
graphwake usage --source datadog --input datadog-usage.json --dry-runWith the Docker image instead, give it the file on standard input: docker run --rm -i -e GRAPHWAKE_USAGE_KEY ghcr.io/graphwake/agent:0.3.0 usage --source datadog --dry-run < datadog-usage.json.
--- would send ---
{"preset":"apim","agentVersion":"0.3.0","windowStart":"2026-11-12","windowEnd":"2026-11-18",
"countsIncluded":true,"unmatchedRequests":412,"withheldRequests":3,"anonymousRequests":7,
"rows":[{"caller":"checkout-web","callerKind":"client","endpointId":"9d2c...",
"service":"orders-api","method":"GET","path":"/orders/{}","count":14200,"lastSeen":"2026-11-18"}]}
--- end ---
Not sent to Graphwake:
Requests that matched no endpoint, by host and path prefix:
- gateway.internal /internal/health 412
Requests withheld because the caller name looked personal: 3
Requests without a caller name: 7Requests that matched none of your endpoints are listed by host and path prefix, at most 20 rows: the prefix is the first two segments of the path, and a segment that contains a digit, @ or %, or is longer than 24 characters, is printed as *. In a real run only their number is sent. If they are calls to your services through a gateway, add a mapping rule on the usage source and run the dry run again.
Step 4: send it on a schedule
Run the calls and the step once a day. Keep the API key and the application key as secrets of the pipeline (DD_API_KEY, DD_APP_KEY), next to the usage key. Graphwake never gets the Datadog keys. Repeat the curl call for each calling service, as the comment in it says.
name: Graphwake usage
on:
schedule:
- cron: "0 5 * * *"
jobs:
usage:
runs-on: ubuntu-latest
steps:
- name: Export the calls from Datadog
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
DD_APP_KEY: ${{ secrets.DD_APP_KEY }}
run: |
rm -f datadog-usage.json
# The call below counts one calling service (orders): repeat it once for each calling service.
# Datadog APM: count outgoing HTTP calls of one service, last 7 days.
# Run once per calling service (replace orders); append every answer to one file.
curl -s -w '\n' -X POST "https://api.${DD_SITE:-datadoghq.com}/api/v2/spans/analytics/aggregate" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d '{"data":{"type":"aggregate_request","attributes":{
"filter":{"from":"now-7d","to":"now","query":"service:orders @span.kind:client"},
"compute":[{"aggregation":"count","type":"total"}],
"group_by":[{"facet":"service","limit":1},
{"facet":"@http.url_details.host","limit":20},
{"facet":"@http.url_details.path","limit":100},
{"facet":"@http.method","limit":5}]}}}' >> datadog-usage.json
- name: Send the usage summary
env:
GRAPHWAKE_USAGE_KEY: ${{ secrets.GRAPHWAKE_USAGE_KEY }}
run: docker run --rm -i -e GRAPHWAKE_USAGE_KEY ghcr.io/graphwake/agent:0.3.0 usage --source datadog < datadog-usage.json.github/workflows/graphwake-usage.yml.schedules:
- cron: '0 5 * * *'
displayName: Daily usage summary
branches:
include: [main]
always: true
trigger: none
pr: none
pool:
vmImage: ubuntu-latest
steps:
- checkout: none
- bash: |
rm -f datadog-usage.json
# The call below counts one calling service (orders): repeat it once for each calling service.
# Datadog APM: count outgoing HTTP calls of one service, last 7 days.
# Run once per calling service (replace orders); append every answer to one file.
curl -s -w '\n' -X POST "https://api.${DD_SITE:-datadoghq.com}/api/v2/spans/analytics/aggregate" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d '{"data":{"type":"aggregate_request","attributes":{
"filter":{"from":"now-7d","to":"now","query":"service:orders @span.kind:client"},
"compute":[{"aggregation":"count","type":"total"}],
"group_by":[{"facet":"service","limit":1},
{"facet":"@http.url_details.host","limit":20},
{"facet":"@http.url_details.path","limit":100},
{"facet":"@http.method","limit":5}]}}}' >> datadog-usage.json
displayName: Export the calls from Datadog
env:
DD_API_KEY: $(DD_API_KEY)
DD_APP_KEY: $(DD_APP_KEY)
- bash: docker run --rm -i -e GRAPHWAKE_USAGE_KEY ghcr.io/graphwake/agent:0.3.0 usage --source datadog < datadog-usage.json
displayName: Send the usage summary
env:
GRAPHWAKE_USAGE_KEY: $(GRAPHWAKE_USAGE_KEY)GRAPHWAKE_USAGE_KEY as a secret variable.Both examples run the agent's Docker image ghcr.io/graphwake/agent:0.3.0 once a day at 05:00 UTC, with the usage key from a secret. The export goes into the container on standard input, which is why docker run has -i.
The agent does not fail the pipeline: it prints one result line, so a summary that was not sent shows as a warning in the job log, not as a red job (a missing file or image still fails the step, and so does the runner stopping the agent before it finishes, for example when it runs out of memory).
Step 5: claim your callers
After the first summary arrives, open Discovery → Callers in Graphwake.
- When Graphwake can suggest a team for a caller, for example because the names match, Confirm adds the caller to that team and Not us dismisses the suggestion.
- Any caller can be claimed with Claim for my team: a team member claims it for their own team, an Admin for any team.
- Every endpoint a claimed caller uses becomes a subscription of that team, and new endpoints follow with later summaries. The next breaking change on them reaches the team in its own channel.
- A subscription the team removes is not added back, and a caller that stops calling keeps its subscriptions. An Admin can ignore a caller that is not a client, such as a health check.
What is sent
- The caller's name. The calling service's name in Datadog, the
servicefacet of its spans. - The endpoint, as a path template such as
/orders/{}, never the concrete path. - How many calls.
- The day the step ran. Datadog's answer carries no day per call.
Other than the one value you choose as the caller name, nothing from a request leaves your network: no body, header, query string or IP address. What the usage step sends lists every field.
Good to know
- The query counts the spans Datadog retained, so counts are approximate.
- Run the query once per calling service and append the answers to one file; one answer holds at most 10,000 groups.
- Each call returns at most 20 hosts and the 100 most-called paths per host for one calling service; endpoints beyond that are missing from the summary.
- If Datadog reports a timeout, the step says the export was incomplete.
Questions
Does Graphwake need our Datadog keys?
No. Your pipeline calls Datadog with your own API key and application key, kept as its secrets. Graphwake holds no credential for Datadog; it receives only the summary.
Why one query per calling service?
One answer holds at most 10,000 groups, so each call counts one calling service. Run it for each service and append the answers to one file; the step reads all of them.
Is Usage Discovery required?
No. It is optional, on Pro and Enterprise. Without it, Graphwake still needs only your spec, and teams subscribe to the endpoints they call.
Pick an endpoint. See who it reaches. 7-day free trial. Cancel before day 7 and you pay nothing.
Start free trialSources and last verified
Sources checked on 2026-11-19.