mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[APM] Add telemetry about the number of environments within the last day (#162315)
Add telemetry about the number of environments within the last day. The indexer will be updated by https://github.com/elastic/telemetry/pull/2402. Closes https://github.com/elastic/kibana/issues/161982 --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
50a9e13035
commit
e298d2c51f
5 changed files with 58 additions and 18 deletions
|
@ -937,6 +937,16 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
|
|||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"environments": {
|
||||
"properties": {
|
||||
"1d": {
|
||||
"type": "long",
|
||||
"_meta": {
|
||||
"description": "Total number of unique environments within the last day"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -776,28 +776,31 @@ export const tasks: TelemetryTask[] = [
|
|||
})
|
||||
).hits.total.value;
|
||||
|
||||
const servicesCount = (
|
||||
await telemetryClient.search({
|
||||
index: [indices.transaction, indices.error, indices.metric],
|
||||
body: {
|
||||
track_total_hits: false,
|
||||
size: 0,
|
||||
timeout,
|
||||
query: {
|
||||
bool: {
|
||||
filter: [range1d],
|
||||
const servicesAndEnvironmentsCount = await telemetryClient.search({
|
||||
index: [indices.transaction, indices.error, indices.metric],
|
||||
body: {
|
||||
track_total_hits: false,
|
||||
size: 0,
|
||||
timeout,
|
||||
query: {
|
||||
bool: {
|
||||
filter: [range1d],
|
||||
},
|
||||
},
|
||||
aggs: {
|
||||
service_name: {
|
||||
cardinality: {
|
||||
field: SERVICE_NAME,
|
||||
},
|
||||
},
|
||||
aggs: {
|
||||
service_name: {
|
||||
cardinality: {
|
||||
field: SERVICE_NAME,
|
||||
},
|
||||
service_environments: {
|
||||
cardinality: {
|
||||
field: SERVICE_ENVIRONMENT,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
).aggregations?.service_name.value;
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
counts: {
|
||||
|
@ -811,7 +814,14 @@ export const tasks: TelemetryTask[] = [
|
|||
'1d': tracesPerDayCount || 0,
|
||||
},
|
||||
services: {
|
||||
'1d': servicesCount || 0,
|
||||
'1d':
|
||||
servicesAndEnvironmentsCount.aggregations?.service_name.value ||
|
||||
0,
|
||||
},
|
||||
environments: {
|
||||
'1d':
|
||||
servicesAndEnvironmentsCount.aggregations?.service_environments
|
||||
.value || 0,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -202,6 +202,15 @@ export const apmSchema: MakeSchemaFrom<APMUsage> = {
|
|||
max_error_groups_per_service: timeframeMapSchema,
|
||||
traces: timeframeMapSchema,
|
||||
services: timeframeMapSchema,
|
||||
environments: {
|
||||
'1d': {
|
||||
...long,
|
||||
_meta: {
|
||||
description:
|
||||
'Total number of unique environments within the last day',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cardinality: {
|
||||
client: { geo: { country_iso_code: { rum: timeframeMap1dSchema } } },
|
||||
|
|
|
@ -108,6 +108,7 @@ export interface APMUsage {
|
|||
max_error_groups_per_service: TimeframeMap;
|
||||
traces: TimeframeMap;
|
||||
services: TimeframeMap;
|
||||
environments: TimeframeMap1d;
|
||||
};
|
||||
cardinality: {
|
||||
client: { geo: { country_iso_code: { rum: TimeframeMap1d } } };
|
||||
|
|
|
@ -4001,6 +4001,16 @@
|
|||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"environments": {
|
||||
"properties": {
|
||||
"1d": {
|
||||
"type": "long",
|
||||
"_meta": {
|
||||
"description": "Total number of unique environments within the last day"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue