const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/api/v2/events2metrics/%7Bid%7D';
let options = {method: 'GET', headers: {Authorization: 'Bearer <API_KEY>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"e2m": {
"id": "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
"name": "Service_catalog_latency",
"description": "avg and max the latency of catalog service",
"createTime": "2022-06-30T12:30:00Z'",
"updateTime": "2022-06-30T12:30:00Z'",
"permutations": {
"limit": 30000,
"hasExceededLimit": true
},
"metricLabels": [
{
"targetLabel": "alias_label_name",
"sourceField": "log_obj.string_value"
}
],
"metricFields": [
{
"targetBaseMetricName": "alias_field_name",
"sourceField": "log_obj.numeric_field",
"aggregations": [
{
"enabled": true,
"aggType": "AGG_TYPE_UNSPECIFIED",
"targetMetricName": "alias_field_name_agg_func",
"samples": {
"sampleType": "SAMPLE_TYPE_UNSPECIFIED"
},
"histogram": {
"buckets": 2
}
}
]
}
],
"type": "E2M_TYPE_UNSPECIFIED",
"spansQuery": {
"lucene": "applicationName:myApp",
"applicationnameFilters": "myApp",
"subsystemnameFilters": "mySubsystem",
"actionFilters": "myAction",
"serviceFilters": "myService"
},
"logsQuery": {
"lucene": "log_obj.numeric_field: [50 TO 100]",
"alias": "new_query",
"applicationnameFilters": "app_name",
"subsystemnameFilters": "sub_name",
"severityFilters": [
"SEVERITY_UNSPECIFIED"
]
},
"isInternal": true
}
}
No description available
const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/api/v2/events2metrics/%7Bid%7D';
let options = {method: 'GET', headers: {Authorization: 'Bearer <API_KEY>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"e2m": {
"id": "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
"name": "Service_catalog_latency",
"description": "avg and max the latency of catalog service",
"createTime": "2022-06-30T12:30:00Z'",
"updateTime": "2022-06-30T12:30:00Z'",
"permutations": {
"limit": 30000,
"hasExceededLimit": true
},
"metricLabels": [
{
"targetLabel": "alias_label_name",
"sourceField": "log_obj.string_value"
}
],
"metricFields": [
{
"targetBaseMetricName": "alias_field_name",
"sourceField": "log_obj.numeric_field",
"aggregations": [
{
"enabled": true,
"aggType": "AGG_TYPE_UNSPECIFIED",
"targetMetricName": "alias_field_name_agg_func",
"samples": {
"sampleType": "SAMPLE_TYPE_UNSPECIFIED"
},
"histogram": {
"buckets": 2
}
}
]
}
],
"type": "E2M_TYPE_UNSPECIFIED",
"spansQuery": {
"lucene": "applicationName:myApp",
"applicationnameFilters": "myApp",
"subsystemnameFilters": "mySubsystem",
"actionFilters": "myAction",
"serviceFilters": "myService"
},
"logsQuery": {
"lucene": "log_obj.numeric_field: [50 TO 100]",
"alias": "new_query",
"applicationnameFilters": "app_name",
"subsystemnameFilters": "sub_name",
"severityFilters": [
"SEVERITY_UNSPECIFIED"
]
},
"isInternal": true
}
}
API key authentication
A successful response.
This data structure is obtained when retrieving an existing event to metric definition
Was this page helpful?