Skip to content

TCO Optimizer HTTP API

This tutorial demonstrates using our TCO Optimizer HTTP API to define, query, and manage your TCO policy overrides, which are used exclusively for logs.

Visit this page to learn how to use our TCO Tracing gPRC API to define, query, and manage your TCO policy criteria, used both for spans and logs.

Base URL

Select the base API endpoint associated with your Coralogix domain.

DomainBase API endpoint
coralogix.us (Ohio)https://api.coralogix.us/api/v1/external/tco/
cx498.coralogix.com (Oregon)https://api.cx498.coralogix.com/api/v1/external/tco/
coralogix.com (Ireland)https://api.coralogix.com/api/v1/external/tco/
eu2.coralogix.com (Stockholm)https://api.eu2.coralogix.com/api/v1/external/tco/
coralogix.in (Mumbai)https://api.app.coralogix.in/api/v1/external/tco/
coralogixsg.com (Singapore)https://api.app.coralogix.com/api/v1/external/tco/
KeyValue
Content-Typeapplication/json
AuthorizationBearer <cx_api_key>

API Key

To use the TCO Optimizer API you need to create a personal or team API key. It’s recommended to use permission presets, as they are automatically updated with all relevant permissions. Alternatively, you can manually add individual permissions.

PresetActionDescription
TCOPoliciesLOGS.TCO:READPOLICIES
LOGS.TCO:UPDATEPOLICIES
SPANS.TCO:READPOLICIES
SPANS.TCO:UPDATEPOLICIES
METRICS.TCO:READPOLICIES
METRICS.TCO:UPDATEPOLICIES
View Logs TCO Policies
Manage Logs TCO Policies
View Tracing TCO Policies
Manage Tracing TCO Policies
View Metrics TCO Policies
Manage Metrics TCO Policies

Usage

Severity Options

NameValue
debug1
verbose2
info3
warning4
error5
critical6

Priority Options

NameValue
blockblock
lowlow
mediummedium
highhigh

Supported Endpoints

Get all policy overrides

GET /overrides

Route example: https://api.coralogix.com/api/v1/external/tco/overrides

Response example:

[
    {
        "id": "dd361b69-89c7-11ec-a5ad-0616c20b31c7",
        "name": "default|recommendationservice|INFO",
        "priority": "high",
        "severity": 3,
        "applicationName": "default",
        "subsystemName": "recommendationservice"
    },
    {
        "id": "61d551af-8f96-11ec-8bfb-02dd69f0920d",
        "name": "default|checkoutservice|DEBUG",
        "priority": "high",
        "severity": 1,
        "applicationName": "default",
        "subsystemName": "checkoutservice"
    }
]

Get single policy override by ID

GET /overrides/{id}

Route example: https://api.coralogix.com/api/v1/external/tco/overrides/*972f6b98-343c-11ee-ac29-061115d0c307*

Response example:

{
    "id": "dd361b69-89c7-11ec-a5ad-0616c20b31c7",
    "name": "default|recommendationservice|INFO",
    "priority": "high",
    "severity": 3,
    "applicationName": "default",
    "subsystemName": "recommendationservice"
}

Create single policy override

POST /overrides

Route example: https://api.coralogix.com/api/v1/external/tco/overrides

Request example:

{
    "priority": "high",
    "severity": 3,
    "applicationName": "default",
    "subsystemName": "blablabla123"
}

Response example:

{
    "priority": "high",
    "severity": 3,
    "applicationName": "default",
    "subsystemName": "blablabla123",
    "id": "972f6b98-343c-11ee-ac29-061115d0c307"
}

Create multiple policy overrides

POST /overrides/bulk

Route example: https://api.coralogix.com/api/v1/external/tco/overrides/bulk

Request example:

[
    {
        "priority": "high",
        "severity": 3,
        "applicationName": "default",
        "subsystemName": "blablabla1234"
    },
    {
        "priority": "high",
        "severity": 3,
        "applicationName": "default",
        "subsystemName": "blablabla12345"
    }
]

Response example:

[
    {
        "status": 200,
        "override": {
            "priority": "high",
            "severity": 3,
            "applicationName": "default",
            "subsystemName": "blablabla1234",
            "id": "2c42a7aa-343d-11ee-ac29-061115d0c307"
        }
    },
    {
        "status": 200,
        "override": {
            "priority": "high",
            "severity": 3,
            "applicationName": "default",
            "subsystemName": "blablabla12345",
            "id": "2c53d05f-343d-11ee-ac29-061115d0c307"
        }
    }
]

Update multiple policy overrides

PUT /overrides/bulk

Route example: https://api.coralogix.com/api/v1/external/tco/overrides/bulk

Request example:

[
    {
        "id": "2c42a7aa-343d-11ee-ac29-061115d0c307",
        "name": "default|blablabla1234|INFO",
        "priority": "high",
        "severity": 3,
        "applicationName": "default",
        "subsystemName": "blablabla1234"
    },
    {
        "id": "2c53d05f-343d-11ee-ac29-061115d0c307",
        "name": "default|blablabla12345|INFO",
        "priority": "high",
        "severity": 3,
        "applicationName": "default",
        "subsystemName": "blablabla12345"
    }
]

Response example:

[
    {
        "status": 200,
        "override": {
            "name": "default|blablabla1234|INFO",
            "priority": "high",
            "severity": 3,
            "applicationName": "default",
            "subsystemName": "blablabla1234",
            "id": "2c42a7aa-343d-11ee-ac29-061115d0c307"
        }
    },
    {
        "status": 200,
        "override": {
            "name": "default|blablabla12345|INFO",
            "priority": "high",
            "severity": 3,
            "applicationName": "default",
            "subsystemName": "blablabla12345",
            "id": "2c53d05f-343d-11ee-ac29-061115d0c307"
        }
    }
]

Delete single policy override

DELETE /overrides/{id}

Route example: https://api.coralogix.com/api/v1/external/tco/overrides/2c53d05f-343d-11ee-ac29-061115d0c307

Response example:

{
    "id": "2c53d05f-343d-11ee-ac29-061115d0c307"
}

Delete multiple policy overrides

DELETE /overrides/bulk

Route example: https://api.coralogix.com/api/v1/external/tco/overrides/bulk

Request example:

[
    {
        "id": "2c42a7aa-343d-11ee-ac29-061115d0c307"
    }
]

Response example:

[
    {
        "status": 200,
        "override": {
            "id": "2c42a7aa-343d-11ee-ac29-061115d0c307"
        }
    }
]

Additional Resources

DocumentationTCO Optimizer
TCO Tracing gPRC API

Support

Need help?

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us via our in-app chat or by sending us an email at [email protected].