Send logs (OTLP/HTTP)
An OTLP/HTTP ExportLogsServiceRequest, protobuf or OTLP/JSON, optionally gzip-compressed. POST /v1/logs is the same endpoint. Point an OpenTelemetry Collector otlphttp exporter at https://mythic-analytics.gulp.workers.dev/i, or an SDK log exporter at this full URL.
Limits: 1 MB on the wire, 4 MB after gzip, 1,000 records per request, 64 KB per record, 30 days of age. Delivery is at least once.
curl -X POST "https://mythic-analytics.gulp.workers.dev/i/v1/logs" \
-H "Content-Type: application/json" \
-H "Content-Encoding: gzip" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"resourceLogs": [
{
"resource": {
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
]
},
"scopeLogs": [
{
"scope": {
"name": "John Doe",
"version": "example_string"
},
"logRecords": [
{
"timeUnixNano": "1789898400000000000",
"observedTimeUnixNano": "example_string",
"severityNumber": 17,
"severityText": "ERROR",
"body": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
},
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
],
"traceId": "5b8efff798038103d269b633813fc60c",
"spanId": "eee19b7ec3c1b174",
"eventName": "John Doe"
}
]
}
]
}
]
}'
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/i/v1/logs"
headers = {
"Content-Type": "application/json",
"Content-Encoding": "gzip",
"Authorization": "Bearer YOUR_API_TOKEN",
"X-Api-Key": "YOUR_API_KEY"
}
data = {
"resourceLogs": [
{
"resource": {
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
]
},
"scopeLogs": [
{
"scope": {
"name": "John Doe",
"version": "example_string"
},
"logRecords": [
{
"timeUnixNano": "1789898400000000000",
"observedTimeUnixNano": "example_string",
"severityNumber": 17,
"severityText": "ERROR",
"body": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
},
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
],
"traceId": "5b8efff798038103d269b633813fc60c",
"spanId": "eee19b7ec3c1b174",
"eventName": "John Doe"
}
]
}
]
}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/i/v1/logs", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Content-Encoding": "gzip",
"Authorization": "Bearer YOUR_API_TOKEN",
"X-Api-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"resourceLogs": [
{
"resource": {
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
]
},
"scopeLogs": [
{
"scope": {
"name": "John Doe",
"version": "example_string"
},
"logRecords": [
{
"timeUnixNano": "1789898400000000000",
"observedTimeUnixNano": "example_string",
"severityNumber": 17,
"severityText": "ERROR",
"body": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
},
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
],
"traceId": "5b8efff798038103d269b633813fc60c",
"spanId": "eee19b7ec3c1b174",
"eventName": "John Doe"
}
]
}
]
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"resourceLogs": [
{
"resource": {
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
]
},
"scopeLogs": [
{
"scope": {
"name": "John Doe",
"version": "example_string"
},
"logRecords": [
{
"timeUnixNano": "1789898400000000000",
"observedTimeUnixNano": "example_string",
"severityNumber": 17,
"severityText": "ERROR",
"body": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
},
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
],
"traceId": "5b8efff798038103d269b633813fc60c",
"spanId": "eee19b7ec3c1b174",
"eventName": "John Doe"
}
]
}
]
}
]
}`)
req, err := http.NewRequest("POST", "https://mythic-analytics.gulp.workers.dev/i/v1/logs", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Content-Encoding", "gzip")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/i/v1/logs')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Content-Encoding'] = 'gzip'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request['X-Api-Key'] = 'YOUR_API_KEY'
request.body = '{
"resourceLogs": [
{
"resource": {
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
]
},
"scopeLogs": [
{
"scope": {
"name": "John Doe",
"version": "example_string"
},
"logRecords": [
{
"timeUnixNano": "1789898400000000000",
"observedTimeUnixNano": "example_string",
"severityNumber": 17,
"severityText": "ERROR",
"body": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
},
"attributes": [
{
"key": "mythic.distinct_id",
"value": {
"stringValue": "example_string",
"boolValue": true,
"intValue": "example_string",
"doubleValue": 3.14,
"arrayValue": {},
"kvlistValue": {},
"bytesValue": "example_string"
}
}
],
"traceId": "5b8efff798038103d269b633813fc60c",
"spanId": "eee19b7ec3c1b174",
"eventName": "John Doe"
}
]
}
]
}
]
}'
response = http.request(request)
puts response.body
{
"partialSuccess": {
"rejectedLogRecords": "2",
"errorMessage": "rejected log records: too_old=2"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Error",
"message": "A google.rpc.Status in the request's encoding. 429 and 503 carry Retry-After and should be retried.",
"code": 413
}
{
"error": "Error",
"message": "A google.rpc.Status in the request's encoding. 429 and 503 carry Retry-After and should be retried.",
"code": 415
}
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later",
"code": 429,
"retryAfter": 3600
}
{
"error": "Service Unavailable",
"message": "The service is temporarily unavailable. Please try again later",
"code": 503
}
/i/v1/logs
Target server for requests. Edit to use your own host.
The location's publishable key (pk_). Ingestion only.
pk_). Ingestion only.The location's publishable key (pk_), as a header. Ingestion only.
pk_), as a header. Ingestion only.The media type of the request body
opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. The location's publishable key (pk_). Ingestion only.
API Key for authentication. The location's publishable key (pk_), as a header. Ingestion only.
Headers
gzipidentity