mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Profiling] fetching latest package version to use in instructions (#160498)
<img width="2461" alt="Screenshot 2023-06-26 at 10 44 41 AM"
src="40c28399
-ba1e-4ab3-a8dd-a8d0c2f9e593">
This commit is contained in:
parent
6b02be4488
commit
f923e9ddc7
2 changed files with 9 additions and 1 deletions
|
@ -329,7 +329,7 @@ docker.elastic.co/observability/profiling-agent:${hostAgentVersion} /root/pf-hos
|
|||
iconType="gear"
|
||||
fill
|
||||
href={`${core.http.basePath.prepend(
|
||||
'/app/integrations/detail/profiler_agent-8.8.0-preview/overview?prerelease=true'
|
||||
`/app/integrations/detail/profiler_agent-${data?.profilerAgent.version}/overview?prerelease=true`
|
||||
)}`}
|
||||
>
|
||||
{i18n.translate('xpack.profiling.tabs.elasticAgentIntegrarion.step2.button', {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import { SavedObjectsClientContract } from '@kbn/core/server';
|
||||
import { PackagePolicyClient } from '@kbn/fleet-plugin/server';
|
||||
import { fetchFindLatestPackageOrThrow } from '@kbn/fleet-plugin/server/services/epm/registry';
|
||||
import { getCollectorPolicy } from './fleet_policies';
|
||||
|
||||
export interface SetupDataCollectionInstructions {
|
||||
|
@ -17,6 +18,9 @@ export interface SetupDataCollectionInstructions {
|
|||
symbolizer: {
|
||||
host?: string;
|
||||
};
|
||||
profilerAgent: {
|
||||
version: string;
|
||||
};
|
||||
}
|
||||
|
||||
export async function getSetupInstructions({
|
||||
|
@ -28,6 +32,7 @@ export async function getSetupInstructions({
|
|||
soClient: SavedObjectsClientContract;
|
||||
apmServerHost?: string;
|
||||
}): Promise<SetupDataCollectionInstructions> {
|
||||
const profilerAgent = await fetchFindLatestPackageOrThrow('profiler_agent', { prerelease: true });
|
||||
const collectorPolicy = await getCollectorPolicy({ packagePolicyClient, soClient });
|
||||
|
||||
if (!collectorPolicy) {
|
||||
|
@ -46,5 +51,8 @@ export async function getSetupInstructions({
|
|||
symbolizer: {
|
||||
host: symbolizerHost,
|
||||
},
|
||||
profilerAgent: {
|
||||
version: profilerAgent.version,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue