$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "metrics": [
< {
< "name": "http.server.request.duration",
< "type": "histogram",
< "unit": "s",
< "bucket_boundaries": [
< 0.005,
< 0.01,
< 0.025,
< 0.05,
< 0.075,
< 0.1,
< 0.25,
< 0.5,
< 0.75,
< 1,
< 2.5,
< 5,
< 7.5,
< 10
< ],
< "temporality": "cumulative",
< "frequency_seconds": 60,
< "attributes": {
< "http.request.method": 6,
< "http.route": 35,
< "http.response.status_code": 14,
< "user.id": 5000
< }
< },
< {
< "name": "http.server.duration",
< "type": "histogram",
< "unit": "ms",
< "temporality": "cumulative",
< "attributes": {
< "http.method": 6,
< "http.route": 35,
< "http.status_code": 14
< }
< },
< {
< "name": "orders.created",
< "type": "counter",
< "frequency_seconds": 10,
< "attributes": {
< "payment.method": 5,
< "order.id": 50000
< }
< },
< {
< "name": "http.client.request.duration",
< "type": "histogram",
< "unit": "s",
< "attributes": {
< "http.request.method": 3,
< "server.address": 4,
< "url.path": {
< "cardinality": 2000,
< "samples": [
< "/v1/charges/8812",
< "/v1/charges/9921/refunds",
< "/v1/customers/1200/cards",
< "/v1/charges/1203"
< ]
< }
< }
< }
< ],
< "analysisName": "checkout-service (production)",
< "resourceAttributes": {
< "service.name": 1,
< "deployment.environment.name": 1,
< "k8s.pod.name": 12
< },
< "collectorConfig": "receivers:\n otlp:\n protocols:\n grpc:\n endpoint: localhost:4317\nprocessors:\n memory_limiter:\n check_interval: 1s\n limit_percentage: 80\n spike_limit_percentage: 25\n batch: {}\nexporters:\n otlphttp:\n endpoint: ${env:OTLP_ENDPOINT}\nservice:\n pipelines:\n metrics:\n receivers: [otlp]\n processors: [memory_limiter, batch]\n exporters: [otlphttp]\n"
<}
<EOF
$curl "https://api.apify.com/v2/actors/michiganpublictech~otel-cardinality-analyzer/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'