mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
Add metrics support for Azure & GCS Gateway (#8954)
We added support for caching and S3 related metrics in #8591. As a continuation, it would be helpful to add support for Azure & GCS gateway related metrics as well.
This commit is contained in:
@@ -146,7 +146,14 @@ func (g *Azure) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, erro
|
||||
return &azureObjects{}, err
|
||||
}
|
||||
|
||||
httpClient := &http.Client{Transport: minio.NewCustomHTTPTransport()}
|
||||
metrics := minio.NewMetrics()
|
||||
|
||||
t := &minio.MetricsTransport{
|
||||
Transport: minio.NewCustomHTTPTransport(),
|
||||
Metrics: metrics,
|
||||
}
|
||||
|
||||
httpClient := &http.Client{Transport: t}
|
||||
userAgent := fmt.Sprintf("APN/1.0 MinIO/1.0 MinIO/%s", minio.Version)
|
||||
|
||||
pipeline := azblob.NewPipeline(credential, azblob.PipelineOptions{
|
||||
@@ -168,6 +175,7 @@ func (g *Azure) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, erro
|
||||
endpoint: endpointURL.String(),
|
||||
httpClient: httpClient,
|
||||
client: client,
|
||||
metrics: metrics,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -357,6 +365,7 @@ type azureObjects struct {
|
||||
minio.GatewayUnsupported
|
||||
endpoint string
|
||||
httpClient *http.Client
|
||||
metrics *minio.Metrics
|
||||
client azblob.ServiceURL // Azure sdk client
|
||||
}
|
||||
|
||||
@@ -460,6 +469,11 @@ func parseAzurePart(metaPartFileName, prefix string) (partID int, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// GetMetrics returns this gateway's metrics
|
||||
func (a *azureObjects) GetMetrics(ctx context.Context) (*minio.Metrics, error) {
|
||||
return a.metrics, nil
|
||||
}
|
||||
|
||||
// Shutdown - save any gateway metadata to disk
|
||||
// if necessary and reload upon next restart.
|
||||
func (a *azureObjects) Shutdown(ctx context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user