Open tcnghia opened 5 months ago
In order to configure the sidecar to scrape another port or path, you need to add a config that will look like:
apiVersion: monitoring.googleapis.com/v1beta
kind: RunMonitoring
metadata:
name: <NAME>
spec:
endpoints:
- port: <PORT>
path: /metrics
interval: 30s
And use secret manager to store this custom configuration and have the sidecar use it (mounting the secret as a volume), docs here: https://cloud.google.com/stackdriver/docs/managed-prometheus/cloudrun-sidecar#sidecar-intro
We're evaluating whether its reasonable to have the config )like above) be stored as an env variable instead, in something like RUN_GMP_CONFIG
, to avoid using secret manager. Would that help this use case as well?
https://github.com/GoogleCloudPlatform/run-gmp-sidecar/pull/23 should solve this as well - list of ports.
Thanks all. Both of these options are very helpful!
It would be very useful to be able to toggle port setting to scrape via terraform, as well.
Our container serves metrics at either port 9090 or 2112. I see that the default configuration expect the port to be 8080.
Currently I don't see an option to customize the metrics port. There is another option of specifying a whole collector config, but then I lose all the nicety of the default config.
Can we please allow specifying the metrics port through an env var like
METRICS_PORT
? If this approach sounds good, I would be happy to help add it.