[APM] Inject agent config directly into APM Fleet policies#99193
[APM] Inject agent config directly into APM Fleet policies#99193ogupte wants to merge 1 commit intoelastic:masterfrom
Conversation
|
Pinging @elastic/apm-ui (Team:apm) |
💔 Build Failed
Failed CI StepsMetrics [docs]Public APIs missing comments
Async chunks
Page load bundle
To update your PR or re-run it, just comment with: |
cauemarcondes
left a comment
There was a problem hiding this comment.
Very nice work. Just added some small comments.
x-pack/plugins/apm/public/components/app/Settings/AgentConfigurations/index.tsx
Show resolved
Hide resolved
| const isFleetSyncLoading = | ||
| packagePolicyInputStatus !== FETCH_STATUS.FAILURE && | ||
| packagePolicyInputStatus !== FETCH_STATUS.SUCCESS; |
There was a problem hiding this comment.
Can't you use Loading instead?
| const isFleetSyncLoading = | |
| packagePolicyInputStatus !== FETCH_STATUS.FAILURE && | |
| packagePolicyInputStatus !== FETCH_STATUS.SUCCESS; | |
| const isFleetSyncLoading = packagePolicyInputStatus === FETCH_STATUS.LOADING |
There was a problem hiding this comment.
I also need it to be true when the status is NOT_INITIATED,i'll probably just include that in the check along with your suggestion.
| const { ['@timestamp']: lastTimestamp } = response.hits.hits[0] | ||
| ._source as { '@timestamp': number }; | ||
| // @ts-ignore |
| }, | ||
| }); | ||
| const agentConfigurations = configurationsSearchResponse.hits.hits | ||
| // @ts-ignore |
There was a problem hiding this comment.
Can you use Type guards to avoid this @ts-ignore?
There was a problem hiding this comment.
I'll see what i can do, I did it because _source has unknown property types when querying with the alertingEsClient
|
|
||
| // enables syncing with fleet-managed apm package policy | ||
| const agentConfigurationFleetSync = createApmServerRoute({ | ||
| endpoint: 'POST /api/apm/settings/agent-configuration/fleet_sync', |
There was a problem hiding this comment.
Should we also add an API to stop the sync?
There was a problem hiding this comment.
If we want the button to also be a toggle, we can do that, otherwise the user is able to stop syncing by navigating to Stack management and delete the rule.
| <h2> | ||
| {i18n.translate( | ||
| 'xpack.apm.agentConfig.configurationsPanelTitle', | ||
| 'xpack.apm.agentConfig.configurationsPanel.title', |
There was a problem hiding this comment.
What was there already was correct according to the Kibana i18n guidelines.
| savedObjectsClient, | ||
| { kuery: 'ingest-package-policies.package.name:apm' } | ||
| ); | ||
| const { config } = packagePolicies.items[0].inputs[0]; |
There was a problem hiding this comment.
If items is an empty array it returns undefined when you request the first element.
Addresses #95501.