curl --request POST \
--url https://api.logfleet.io/api/v1/metric-configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scope": {
"type": "all",
"locations": [
"<string>"
],
"tags": [
"<string>"
]
},
"description": "<string>",
"metrics": [
{
"name": "<string>",
"type": "counter",
"source_field": "<string>",
"namespace": "edge",
"description": "<string>",
"filter": {
"field": "<string>",
"operator": "eq",
"value": "<string>",
"conditions": "<array>",
"logic": "and"
},
"tags": [
{
"name": "<string>",
"source": "field",
"value": "<string>"
}
],
"counter_opts": {
"increment_by": "<string>"
},
"gauge_opts": {
"value_field": "<string>"
},
"histogram_opts": {
"value_field": "<string>",
"buckets": [
123
]
},
"cardinality": {
"max_tag_cardinality": 1000,
"on_limit_exceeded": "drop"
}
}
]
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"version": 123,
"enabled": true,
"scope": {
"type": "all",
"locations": [
"<string>"
],
"tags": [
"<string>"
]
},
"metrics": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"namespace": "<string>",
"description": "<string>",
"enabled": true,
"type": "counter",
"source_field": "<string>",
"filter": {
"field": "<string>",
"operator": "eq",
"value": "<string>",
"conditions": "<array>",
"logic": "and"
},
"tags": [
{
"name": "<string>",
"source": "field",
"value": "<string>"
}
],
"counter_opts": {
"increment_by": "<string>"
},
"gauge_opts": {
"value_field": "<string>"
},
"histogram_opts": {
"value_field": "<string>",
"buckets": [
123
]
},
"cardinality": {
"max_tag_cardinality": 1000,
"on_limit_exceeded": "drop"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Create a new metric extraction configuration
curl --request POST \
--url https://api.logfleet.io/api/v1/metric-configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scope": {
"type": "all",
"locations": [
"<string>"
],
"tags": [
"<string>"
]
},
"description": "<string>",
"metrics": [
{
"name": "<string>",
"type": "counter",
"source_field": "<string>",
"namespace": "edge",
"description": "<string>",
"filter": {
"field": "<string>",
"operator": "eq",
"value": "<string>",
"conditions": "<array>",
"logic": "and"
},
"tags": [
{
"name": "<string>",
"source": "field",
"value": "<string>"
}
],
"counter_opts": {
"increment_by": "<string>"
},
"gauge_opts": {
"value_field": "<string>"
},
"histogram_opts": {
"value_field": "<string>",
"buckets": [
123
]
},
"cardinality": {
"max_tag_cardinality": 1000,
"on_limit_exceeded": "drop"
}
}
]
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"version": 123,
"enabled": true,
"scope": {
"type": "all",
"locations": [
"<string>"
],
"tags": [
"<string>"
]
},
"metrics": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"namespace": "<string>",
"description": "<string>",
"enabled": true,
"type": "counter",
"source_field": "<string>",
"filter": {
"field": "<string>",
"operator": "eq",
"value": "<string>",
"conditions": "<array>",
"logic": "and"
},
"tags": [
{
"name": "<string>",
"source": "field",
"value": "<string>"
}
],
"counter_opts": {
"increment_by": "<string>"
},
"gauge_opts": {
"value_field": "<string>"
},
"histogram_opts": {
"value_field": "<string>",
"buckets": [
123
]
},
"cardinality": {
"max_tag_cardinality": 1000,
"on_limit_exceeded": "drop"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}JWT token obtained from /auth/login