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
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import * as t from 'io-ts';

export const loggingLevelRt = t.union([
t.literal('trace'),
t.literal('debug'),
t.literal('info'),
t.literal('warn'),
t.literal('error'),
t.literal('fatal'),
t.literal('off'),
]);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import { i18n } from '@kbn/i18n';
import type { RawSettingDefinition } from './types';
import { loggingLevelRt } from '../runtime_types/logging_level_rt';

export const edotSDKSettings: RawSettingDefinition[] = [
{
Expand Down Expand Up @@ -45,6 +46,28 @@ export const edotSDKSettings: RawSettingDefinition[] = [
),
includeAgents: ['opentelemetry/java/elastic'],
},
{
key: 'logging_level',
validation: loggingLevelRt,
type: 'select',
defaultValue: 'info',
label: i18n.translate('xpack.apm.agentConfig.loggingLevel.label', {
defaultMessage: 'Logging level',
}),
description: i18n.translate('xpack.apm.agentConfig.loggingLevel.description', {
defaultMessage: 'Sets the logging level for the agent',
}),
options: [
{ text: 'trace', value: 'trace' },
{ text: 'debug', value: 'debug' },
{ text: 'info', value: 'info' },
{ text: 'warn', value: 'warn' },
{ text: 'error', value: 'error' },
{ text: 'fatal', value: 'fatal' },
{ text: 'off', value: 'off' },
],
includeAgents: ['opentelemetry/java/elastic'],
},
{
key: 'send_traces',
type: 'boolean',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,17 @@ describe('filterByAgent', () => {
});

it('opentelemetry/java/elastic', () => {
expect(getSettingKeysForAgent('opentelemetry/java/elastic')).toEqual([
'deactivate_all_instrumentations',
'deactivate_instrumentations',
'recording',
'send_logs',
'send_metrics',
'send_traces',
]);
expect(getSettingKeysForAgent('opentelemetry/java/elastic')).toEqual(
expect.arrayContaining([
'deactivate_all_instrumentations',
'deactivate_instrumentations',
'logging_level',
'recording',
'send_logs',
'send_metrics',
'send_traces',
])
);
});

it('"All" services (no agent name)', () => {
Expand Down