How to set up Platform Insights for your APM service provider.
eventTypes field in your configuration:- Metrics: aggregated request data, including attributes such as
endpoint,http_method, andhttp_status. Use this to monitor API performance and usage patterns. - Logs: individual request log entries. Use this for detailed tracing and debugging.
providers array of a single request.Prerequisites
Before you begin, make sure you have the following:
- A commercetools Project with an API Client that has the
manage_project_settings:{projectKey}scope. Replace the{region}placeholder in the request URLs with the value for your Project's Region. For the available values, see Hosts. - A Bearer Token for your API Client. For guidance on obtaining one, see Client credentials flow.
- The Platform Insights add-on activated for your commercetools Project.
- An active account with your chosen APM provider.
New Relic
With this API key, you can configure Platform Insights to send data to New Relic.
region are eu and us:curl -X PUT https://api.{region}.commercetools.com/{projectKey}/insights-configuration -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"providers" : [ {
"type" : "NewRelic",
"region" : "eu",
"apiKey" : "eu12345NRAL",
"eventTypes" : [ "Metrics", "Logs" ]
} ]
}
DATA
After a successful response, it may take up to five minutes for the data to start flowing to New Relic.
View the commercetools service
Metrics
ct_, and you can filter them in the data explorer.
endpoint, http_method, and http_status to help you understand the performance of your API usage.
Logs
Logs in the eventTypes array of your configuration request.
Datadog
Create a new API key and copy its value.
With this API key, you can configure Platform Insights to send data to Datadog.
Send a PUT request to the following endpoint with the API key and site in the body:
curl -X PUT https://api.{region}.commercetools.com/{projectKey}/insights-configuration -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"providers" : [ {
"type" : "Datadog",
"site" : "EU1",
"apiKey" : "ddApiKey12345",
"eventTypes" : [ "Metrics", "Logs" ]
} ]
}
DATA
site to the value that matches your Datadog organization. The following values are supported: US1, US3, US5, EU1, US1-FED, and AP1.After a successful response, it may take up to five minutes for the data to start flowing to Datadog.
Metrics
ct_ and include attributes such as endpoint, http_method, and http_status. You can explore them using the Metrics Explorer in your Datadog account.
Logs
Logs in the eventTypes array of your configuration request.
Dynatrace
Ingest-Logs and Ingest-Metrics scopes.
https://dtMyEnvironment.live.dynatrace.com, your environment ID is dtMyEnvironment.With the token and environment ID, send a PUT request to configure Platform Insights:
curl -X PUT https://api.{region}.commercetools.com/{projectKey}/insights-configuration -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"providers" : [ {
"type" : "DynatraceSaaS",
"environmentId" : "dtMyEnvironment",
"apiKey" : "dtabc1234",
"eventTypes" : [ "Metrics", "Logs" ]
} ]
}
DATA
After a successful response, it may take up to five minutes for the data to start flowing to Dynatrace.
Metrics
ct_ and include attributes such as endpoint, http_method, and http_status. You can create a new dashboard to visualize them in a panel.
Logs
Logs in the eventTypes array of your configuration request. After configuration, Platform Insights sends request logs from commercetools directly to Dynatrace.
Verify your configuration
To confirm that your configuration was saved correctly, send a GET request to the same endpoint:
curl -X GET https://api.{region}.commercetools.com/{projectKey}/insights-configuration \
--header "Authorization: Bearer ${BEARER_TOKEN}"
ProjectConfiguration object with your active providers, their event types, and the time the configuration was last modified.