mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-11 21:23:12 +01:00
Introduce two new Prometheus metrics sourced from the Barman Cloud plugin: - `barman_cloud_cloudnative_pg_io_first_recoverability_point` - `barman_cloud_cloudnative_pg_io_last_available_backup_timestamp` These metrics supersede the following deprecated CNPG metrics: - `cnpg_collector_first_recoverability_point` - `cnpg_collector_last_available_backup_timestamp` Depends on: https://github.com/cloudnative-pg/cloudnative-pg/pull/8033 Relates to: #380 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
67 lines
1.7 KiB
Go
67 lines
1.7 KiB
Go
package instance
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/cloudnative-pg/cnpg-i/pkg/identity"
|
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
|
|
|
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/metadata"
|
|
)
|
|
|
|
// IdentityImplementation implements IdentityServer
|
|
type IdentityImplementation struct {
|
|
identity.UnimplementedIdentityServer
|
|
Client client.Client
|
|
}
|
|
|
|
// GetPluginMetadata implements IdentityServer
|
|
func (i IdentityImplementation) GetPluginMetadata(
|
|
_ context.Context,
|
|
_ *identity.GetPluginMetadataRequest,
|
|
) (*identity.GetPluginMetadataResponse, error) {
|
|
return &metadata.Data, nil
|
|
}
|
|
|
|
// GetPluginCapabilities implements IdentityServer
|
|
func (i IdentityImplementation) GetPluginCapabilities(
|
|
_ context.Context,
|
|
_ *identity.GetPluginCapabilitiesRequest,
|
|
) (*identity.GetPluginCapabilitiesResponse, error) {
|
|
return &identity.GetPluginCapabilitiesResponse{
|
|
Capabilities: []*identity.PluginCapability{
|
|
{
|
|
Type: &identity.PluginCapability_Service_{
|
|
Service: &identity.PluginCapability_Service{
|
|
Type: identity.PluginCapability_Service_TYPE_WAL_SERVICE,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
Type: &identity.PluginCapability_Service_{
|
|
Service: &identity.PluginCapability_Service{
|
|
Type: identity.PluginCapability_Service_TYPE_BACKUP_SERVICE,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
Type: &identity.PluginCapability_Service_{
|
|
Service: &identity.PluginCapability_Service{
|
|
Type: identity.PluginCapability_Service_TYPE_METRICS,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}, nil
|
|
}
|
|
|
|
// Probe implements IdentityServer
|
|
func (i IdentityImplementation) Probe(
|
|
_ context.Context,
|
|
_ *identity.ProbeRequest,
|
|
) (*identity.ProbeResponse, error) {
|
|
return &identity.ProbeResponse{
|
|
Ready: true,
|
|
}, nil
|
|
}
|