mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Fleet] Action APM tracing (#139849)
## Summary Related to https://github.com/elastic/ingest-dev/issues/1489 Add a `traceparent` field to actions created in `.fleet-actions` Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
This commit is contained in:
parent
24c106907f
commit
d9bd659ab5
2 changed files with 7 additions and 1 deletions
|
@ -389,7 +389,10 @@ export interface FleetServerAgentAction {
|
|||
data?: {
|
||||
[k: string]: unknown;
|
||||
};
|
||||
|
||||
total?: number;
|
||||
|
||||
/** Trace id */
|
||||
traceparent?: string | null;
|
||||
|
||||
[k: string]: unknown;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server';
|
||||
import apm from 'elastic-apm-node';
|
||||
|
||||
import { appContextService } from '../app_context';
|
||||
import type {
|
||||
|
@ -50,6 +51,7 @@ export async function createAgentAction(
|
|||
minimum_execution_duration: newAgentAction.minimum_execution_duration,
|
||||
rollout_duration_seconds: newAgentAction.rollout_duration_seconds,
|
||||
total: newAgentAction.total,
|
||||
traceparent: apm.currentTraceparent,
|
||||
};
|
||||
|
||||
await esClient.create({
|
||||
|
@ -98,6 +100,7 @@ export async function bulkCreateAgentActions(
|
|||
action_id: action.id,
|
||||
data: action.data,
|
||||
type: action.type,
|
||||
traceparent: apm.currentTraceparent,
|
||||
};
|
||||
|
||||
return [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue