Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1451ce8
Add tests about composing pipeline
jsoriano Aug 27, 2025
810ab5d
Initial composition of pipelines
jsoriano Aug 28, 2025
bf8827f
Refactor how suffix is added
jsoriano Aug 29, 2025
3b8492c
Merge remote-tracking branch 'origin/main' into otel-exporters
jsoriano Sep 8, 2025
15b9431
Use Record utility type
jsoriano Sep 8, 2025
7e3efe2
Add id to exporter
jsoriano Sep 8, 2025
c548a7b
Add test with multiple components of the same type
jsoriano Sep 8, 2025
737954c
Cleanup
jsoriano Sep 8, 2025
503160f
Add routing attributes
jsoriano Sep 8, 2025
289f6b4
Avoid dots in OTel config keys
jsoriano Sep 8, 2025
63f3ccc
Add context to transform processor
jsoriano Sep 8, 2025
2f00fae
Remove unneeded change
jsoriano Sep 9, 2025
27abc16
Nit
jsoriano Sep 9, 2025
50c9c7b
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Sep 9, 2025
7621efb
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Sep 9, 2025
6fb5a0d
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Sep 9, 2025
1698eee
Linting
jsoriano Sep 9, 2025
ca413e7
Fix config generation with templates
jsoriano Sep 9, 2025
ed45a44
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Sep 9, 2025
fe54274
Remove space reverted by mistake
jsoriano Sep 10, 2025
79ccd0f
Merge remote-tracking branch 'origin/main' into otel-exporters
jsoriano Sep 10, 2025
9d22a3a
Merge remote-tracking branch 'jsoriano/otel-exporters' into otel-expo…
jsoriano Sep 10, 2025
45cf8c2
Remove unused variable
jsoriano Sep 10, 2025
94d7e80
Fix more tests
jsoriano Sep 10, 2025
88c6bd9
Review types of added functions
jsoriano Sep 11, 2025
7b62e81
Merge remote-tracking branch 'origin/main' into otel-exporters
jsoriano Sep 11, 2025
dac36ea
Move OTel collector helpers to their own file
jsoriano Sep 11, 2025
8df4f74
Merge remote-tracking branch 'origin/main' into otel-exporters
jsoriano Sep 11, 2025
bd5729f
Update x-pack/platform/plugins/shared/fleet/server/services/agent_pol…
jsoriano Sep 15, 2025
4e5f4be
Merge branch 'main' into otel-exporters
elasticmachine Sep 15, 2025
b4c6276
Missing import
jsoriano Sep 15, 2025
fe2af2d
Merge remote-tracking branch 'origin/main' into otel-exporters
jsoriano Sep 15, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ import type {
FleetProxy,
FleetServerHost,
AgentPolicy,
TemplateAgentPolicyInput,
} from '../../types';
import type {
DownloadSource,
FullAgentPolicyDownload,
FullAgentPolicyInput,
FullAgentPolicyMonitoring,
FullAgentPolicyOutputPermissions,
OTelCollectorConfig,
PackageInfo,
} from '../../../common/types';
import { agentPolicyService } from '../agent_policy';
Expand Down Expand Up @@ -64,6 +62,7 @@ import {
DEFAULT_CLUSTER_PERMISSIONS,
} from './package_policies_to_agent_permissions';
import { fetchRelatedSavedObjects } from './related_saved_objects';
import { generateOtelcolConfig } from './otel_collector';

async function fetchAgentPolicy(soClient: SavedObjectsClientContract, id: string) {
try {
Expand Down Expand Up @@ -162,7 +161,7 @@ export async function getFullAgentPolicy(

let otelcolConfig;
if (experimentalFeature.enableOtelIntegrations) {
otelcolConfig = generateOtelcolConfig(agentInputs);
otelcolConfig = generateOtelcolConfig(agentInputs, dataOutput);
}

const inputs = agentInputs
Expand Down Expand Up @@ -891,25 +890,3 @@ export function getBinarySourceSettings(
}
return config;
}

// Generate OTel Collector policy
export function generateOtelcolConfig(inputs: FullAgentPolicyInput[] | TemplateAgentPolicyInput[]) {
const otelConfig = inputs.flatMap((input) => {
if (input.type === OTEL_COLLECTOR_INPUT_TYPE) {
const otelInputs: OTelCollectorConfig[] = (input?.streams ?? []).flatMap((inputStream) => {
return {
...(inputStream?.receivers ? { receivers: inputStream.receivers } : {}),
...(inputStream?.service ? { service: inputStream.service } : {}),
...(inputStream?.extensions ? { service: inputStream.extensions } : {}),
...(inputStream?.processors ? { service: inputStream.processors } : {}),
...(inputStream?.connectors ? { service: inputStream.connectors } : {}),
...(inputStream?.exporters ? { service: inputStream.exporters } : {}),
};
});

return otelInputs;
}
});

return otelConfig.length > 0 ? otelConfig[0] : {};
}
Loading
Loading