Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

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 @@ -351,6 +351,31 @@ describe('getNormalizedDataStreams', () => {
},
]);
});

it('should add use_apm var with default true for otel traces input', () => {
const result = getNormalizedDataStreams({
...integrationPkg,
type: 'input',
policy_templates: [
{
input: 'otelcol',
type: 'traces',
name: 'otel-traces',
template_path: 'some/path.hbl',
title: 'OTel Traces',
description: 'OTel Traces',
vars: [],
},
],
});
expect(result).toHaveLength(1);
expect(result[0].streams).toHaveLength(1);
const vars = result[0].streams![0].vars;
const useApmVar = vars?.find((v) => v.name === 'use_apm');
expect(useApmVar).toBeDefined();
expect(useApmVar?.default).toEqual(true);
expect(useApmVar?.title).toEqual('Use Elastic APM');
});
});

describe('filterPolicyTemplatesTiles', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ const DATA_STREAM_DATASET_VAR: RegistryVarsEntry = {
const DATA_STREAM_USE_APM_VAR: RegistryVarsEntry = {
name: USE_APM_VAR_NAME,
type: 'bool',
title: 'Use APM Server',
title: 'Use Elastic APM',
description: 'enables the apm collector and processor.',
multi: false,
required: false,
show_user: true,
default: true,
};

export function packageHasNoPolicyTemplates(packageInfo: PackageInfo): boolean {
Expand Down
Loading