Skip to content

docs: Fix nested array in telemetries example in configuration.md #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Artem-asd
Copy link

Fix incorrect nested array in telemetries example in configuration.md

This PR corrects an inconsistency in the telemetries configuration example in configuration.md.

The current example:

telemetries: [
    [
        'errors',
        'http',
        [
            'performance',
            {
                ignore: (entry: PerformanceEntry) => {
                    return entry.entryType === 'resource';
                }
            }
        ]
    ]
];

is wrapped in an unnecessary nested array, which may mislead users into thinking that all telemetry types need to be grouped inside a single array element.

Why this change is needed
Other valid examples in the same document use a flat array of telemetry definitions. For example:

telemetries: ['errors', 'performance', 'http'];

Or:

telemetries: [
    ['errors', { stackTraceLength: 500 }],
    'performance',
    ['http', { stackTraceLength: 500, addXRayTraceIdHeader: true }]
];

Or:

telemetries: [
    [
        'errors',
        {
            stackTraceLength: 500,
            ignore: (errorEvent) => {
                return (
                    errorEvent &&
                    errorEvent.message &&
                    /^Warning:/.test(errorEvent.message)
                );
            }
        }
    ],
    'performance',
    'http'
];

To stay consistent with the examples above, the updated version should be:

telemetries: [
    'errors',
    'http',
    [
        'performance',
        {
            ignore: (entry: PerformanceEntry) => {
                return entry.entryType === 'resource';
            }
        }
    ]
];

This change helps avoid confusion and ensures consistency across the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant