Skip to content

Commit

Permalink
[APM] Improvments in the APM fleet integration (elastic#95501)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogupte committed Jun 9, 2021
1 parent 4021576 commit b975480
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export function getPackagePolicyWithAgentConfigurations(
{
...firstInput,
config: {
...firstInput.config,
[APM_SERVER]: {
value: {
...apmServerValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import type { PackagePolicy, FullAgentPolicyInput, FullAgentPolicyInputStream } from '../types';
import { DEFAULT_OUTPUT } from '../constants';
import { merge } from 'lodash';

export const storedPackagePoliciesToAgentInputs = (
packagePolicies: PackagePolicy[]
Expand All @@ -31,10 +32,6 @@ export const storedPackagePoliciesToAgentInputs = (
namespace: packagePolicy.namespace || 'default',
},
use_output: DEFAULT_OUTPUT.name,
...Object.entries(input.config || {}).reduce((acc, [key, { value }]) => {
acc[key] = value;
return acc;
}, {} as { [k: string]: any }),
...(input.compiled_input || {}),
...(input.streams.length
? {
Expand All @@ -56,6 +53,14 @@ export const storedPackagePoliciesToAgentInputs = (
: {}),
};

merge(
fullInput,
Object.entries(input.config || {}).reduce(
(acc, [key, { value }]) => ({ ...acc, [key]: value }),
{}
)
);

if (packagePolicy.package) {
fullInput.meta = {
package: {
Expand Down

0 comments on commit b975480

Please sign in to comment.