Tag API

Listing All Tags

End Point:

GET /api/v1/tags

Curl examples:

curl -X GET "https://YOUR-API-KEY-HERE@api.hostedgraphite.com/api/v1/tags"

Search for all the tag lists

Response format:

HTTP/1.1 200
Content-Type: application/json

["cluster", "host", "process", "service", "name"]

Status Codes:

  • 200 - Success

Search Tagged Metrics

End Point:

GET /api/v1/tags/findSeries?
GET /api/v1/tags/<tagname>?

Curl examples:

curl -X GET "https://YOUR-API-KEY-HERE@api.hostedgraphite.com/api/v1/tags/findSeries?expr=cluster=prod"

Search for tagged metric/series that match the expression cluster=prod

curl -X GET "https://YOUR-API-KEY-HERE@api.hostedgraphite.com/api/v1/tags/host?filter=prod-00*&limit=3"

Search for tagname host that match the value prod and only show 3 matching results.

Available Parameters:

  • filter
    Format: filter=prod-00*
    Tag value to search for.
  • expr
    Format: expr=cluster=prod
    To search for the tagged series that match the expression.
  • limit
    Format: limit=3
    To limit the amount of search results to the given number.

Response format with ‘?expr=cluster=prod’:

HTTP/1.1 200
Content-Type: application/json

["0.queue_backlog;cluster=prod;host=prod-egg-0021;process=grind;service=data_process", "2.queue_backlog;cluster=prod;host=prod-egg-0021;process=grind;service=data_process", "0.items;cluster=prod;host=prod-egg-001;process=dump;service=data_process"]

Response format with ‘?filter=machine-000*&limit=3’:

HTTP/1.1 200
Content-Type: application/json

{"tag": "host",
 "values": [{"count": 59, "value": "machine-0001"},
            {"count": 57, "value": "machine-0002"},
            {"count": 59, "value": "machine-0003"}]
}

Response Parameters:

  • tag
    Tag name.
  • values
    Tag value.

Status Codes:

  • 200 - Success
  • 400 - Invalid format
  • 501 - Not implemented

Deleting Tagged Metrics

End Point:

POST /api/v1/tags/delSeries

Curl example:

curl -X POST "https://YOUR-API-KEY-HERE@api.hostedgraphite.com/api/v1/tags/delSeries" --data-urlencode "path=foo.bar;tag1=val1;tag2=val2"

Delete all seires that match the path foo.bar and tag1=val1 and tag2=val2.

Status Codes:

  • 200 - Success
  • 400 - Invalid request.