Slide 2 of 4

HTTP API for logs

HTTP API for logs

The HTTP API is a REST endpoint for sending logs to Grafana Cloud Logs, and any HTTP client can use it. It’s a good fit for batch jobs, serverless functions, IoT devices, and CI/CD workflows where deploying a collector isn’t practical.

HTTP API logs flow

For stable, long-running systems, a collector like Grafana Alloy or Fluent Bit is often a better fit.

Considerations

  • Works with any HTTP client, sending logs as JSON. No SDK required.
  • A good fit for batch jobs, serverless, IoT, and CI/CD where you can’t run a collector.
  • You handle batching, retries, and buffering yourself, which a collector would otherwise manage.

Learn more

This method is walked through in a Grafana blog post.

Script

The HTTP API is a REST endpoint that accepts log entries via HTTP POST. Any tool, script, or application that can make HTTP requests can send logs this way.

The Grafana Cloud Logs HTTP API accepts logs as JSON, with labels and log lines. You authenticate with your Grafana Cloud credentials, POST your logs to the endpoint, and they’re stored immediately.

You can use it from shell scripts with curl, from custom applications, from serverless functions, or from any log shipper that supports HTTP outputs. No SDK is required, just HTTP.

The HTTP API is a good fit when deploying a collector isn’t practical: batch jobs, serverless functions, IoT devices, and CI/CD workflows, where each run can send its logs directly over HTTP. For stable, long-running systems, a collector like Grafana Alloy or Fluent Bit is often a better fit, since it manages batching, retries, and buffering for you.