-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Prepare APM agent configuration for production use #78697
Conversation
8c209cd
to
140e7db
Compare
140e7db
to
08aeaf6
Compare
Pinging @elastic/kibana-platform (Team:Platform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the mentioned comment.
@@ -30,8 +30,13 @@ const getDefaultConfig = (isDistributable: boolean): ApmAgentConfig => { | |||
return { | |||
active: false, | |||
globalLabels: {}, | |||
centralConfig: false, | |||
captureHeaders: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment explaining why it's disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am erring on the side of caution here and trying to avoid capturing any data that could be sensitive. We could be more selective about this and capture only headers we know to be safe (an allowlist of headers). WDYT?
@@ -30,8 +30,13 @@ const getDefaultConfig = (isDistributable: boolean): ApmAgentConfig => { | |||
return { | |||
active: false, | |||
globalLabels: {}, | |||
centralConfig: false, | |||
captureHeaders: false, | |||
captureBody: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.in elatic-apm-node/index.d.ts
:
type CaptureBody = 'off' | 'errors' | 'transactions' | 'all';
- is it possible to improve type safety of
export type ApmAgentConfig = Record<string, any>;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pgayvallet I believe we were needing some type changes from APM agent for this correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AgentConfigOptions is not exported from @elastic/apm-rum
, but we could declare a compatible interface, maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will handle in follow up. Should not affect 7.10 since we still need to add config-schema validation for 'productionizing' this feature.
*/ | ||
constructor(private readonly apmConfig?: ApmConfig) { | ||
this.enabled = process.env.IS_KIBANA_DISTRIBUTABLE !== 'true' && apmConfig != null; | ||
this.enabled = apmConfig != null && !!apmConfig.active; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a hard time debugging the config. It's turned out we don't read values from kibana.dev.yml
. It might be another source of confusion for developers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's turned out we don't read values from
kibana.dev.yml
I think there was some confusion on whether or not we still supported this. It appears we do. Can fix as a follow up so I can get this in for FF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened issue: #79490
Should be a pretty quick follow up
Pushed updates that addressed comments here and also fixed the APM serviceName in development (was broken by #79379, resulting in the main server and basePath proxy server both reporting as the "kibana-proxy" service) |
💚 Build SucceededMetrics [docs]page load bundle size
History
To update your PR or re-run it, just comment with: |
Summary