Merge pull request #31053 from backstage/sennyeya/instance-metadata-update

feat: promote instance metadata
This commit is contained in:
Patrik Oldsberg
2025-11-04 13:11:40 +01:00
committed by GitHub
22 changed files with 403 additions and 91 deletions
+5 -5
View File
@@ -17,21 +17,21 @@ import {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import { instanceMetadataServiceRef } from '@backstage/backend-plugin-api/alpha';
// Example usage of the instance metadata service to log the installed features.
// Example usage of the instance metadata service to log the installed plugins.
export default createBackendPlugin({
pluginId: 'instance-metadata-logging',
register(env) {
env.registerInit({
deps: {
instanceMetadata: instanceMetadataServiceRef,
instanceMetadata: coreServices.rootInstanceMetadata,
logger: coreServices.logger,
},
async init({ instanceMetadata, logger }) {
const plugins = await instanceMetadata.getInstalledPlugins();
logger.info(
`Installed features on this instance: ${instanceMetadata
.getInstalledFeatures()
`Installed plugins on this instance: ${plugins
.map(e => e.pluginId)
.join(', ')}`,
);
},