Skip to content

[GCP] Metricset metrics client allow overriding the endpoint #40848

Closed
@alexsapran

Description

The GCP metricset metric as I was looking at

client, err := monitoring.NewMetricClient(ctx, m.config.opt...)

We are not able to override the api endpoint. It would be good to be able to do that if we want to test against a fake GCP API endpoint.

Looking at the source code of the client https://github.com/googleapis/google-cloud-go/blob/4265accaab624984d7ea60025e24198a0a0db6d3/monitoring/apiv3/metric_client.go#L55 it looks it gives us the ability to define the option option.WithEndpoint(...)

Preferably, it would be good to override with some env var.

This will be useful in the effort we are starting with doing performance work for metricbeat.

Not sure which team is more suited for this ask; I am just pinging both teams from the codeowners
@elastic/obs-ds-hosted-services or @elastic/obs-infraobs-integrations

Sorry for the noise. If you feel you are in the wrong group or the file is not up-to-date.

/cc @cachedout @ablnk

Metadata

Assignees

Labels

Team:Obs-InfraObsLabel for the Observability Infrastructure Monitoring teamTeam:obs-ds-hosted-servicesLabel for the Observability Hosted Services team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions