Stackdriver / stackdriver-prometheus-sidecar

A sidecar for the Prometheus server that can send metrics to Stackdriver.
https://cloud.google.com/monitoring/kubernetes-engine/prometheus
Apache License 2.0
120 stars 43 forks source link

--include flag depreciated? #161

Closed castlemilk closed 4 years ago

castlemilk commented 5 years ago

Running go get github.com/Stackdriver/stackdriver-prometheus-sidecar/... fetches an unknown version of the binary. This is indicated by running stackdriver-prometheus-sidecar --version, which returns:

prometheus, version  (branch: , revision: )
  build user:
  build date:
  go version:       go1.12.5

When running --help we have the following output:

stackdriver-prometheus-sidecar --helpusage: stackdriver-prometheus-sidecar --stackdriver.project-id=STACKDRIVER.PROJECT-ID [<flags>]

The Prometheus monitoring server

Flags:
  -h, --help                     Show context-sensitive help (also try --help-long and --help-man).
      --version                  Show application version.
      --config-file=CONFIG-FILE  A configuration file.
      --stackdriver.project-id=STACKDRIVER.PROJECT-ID
                                 The Google project ID where Stackdriver will store the metrics.
      --stackdriver.api-address=https://monitoring.googleapis.com:443/
                                 Address of the Stackdriver Monitoring API.
      --stackdriver.kubernetes.location=STACKDRIVER.KUBERNETES.LOCATION
                                 Value of the 'location' label in the Kubernetes Stackdriver MonitoredResources.
      --stackdriver.kubernetes.cluster-name=STACKDRIVER.KUBERNETES.CLUSTER-NAME
                                 Value of the 'cluster_name' label in the Kubernetes Stackdriver MonitoredResources.
      --stackdriver.generic.location=STACKDRIVER.GENERIC.LOCATION
                                 Location for metrics written with the generic resource, e.g. a cluster or data center name.
      --stackdriver.generic.namespace=STACKDRIVER.GENERIC.NAMESPACE
                                 Namespace for metrics written with the generic resource, e.g. a cluster or data center name.
      --stackdriver.metrics-prefix=STACKDRIVER.METRICS-PREFIX
                                 Customized prefix for Stackdriver metrics. If not set, external.googleapis.com/prometheus will be used
      --stackdriver.use-gke-resource
                                 Whether to use the legacy gke_container MonitoredResource type instead of k8s_container
      --prometheus.wal-directory="data/wal"
                                 Directory from where to read the Prometheus TSDB WAL.
      --prometheus.api-address=http://127.0.0.1:9090/
                                 Address to listen on for UI, API, and telemetry.
      --web.listen-address="0.0.0.0:9091"
                                 Address to listen on for UI, API, and telemetry.
      --filter=FILTER ...        PromQL-style label matcher which must pass for a series to be forwarded to Stackdriver. May be repeated.
      --log.level=info           Only log messages with the given severity or above. One of: [debug, info, warn, error]

note that there's no flag for --include, which is still references in the main README.md for the repo. Has this capability been depreciated?

davidbtucker commented 4 years ago

Hi, the --include flag is still supported.

In https://github.com/Stackdriver/stackdriver-prometheus-sidecar/blob/master/cmd/stackdriver-prometheus-sidecar/main.go, there's:

a.Flag("include", "PromQL metric and label matcher which must pass for a series to be forwarded to Stackdriver. If repeated, the series must pass any of the filter sets to be forwarded.").
    StringsVar(&cfg.Filtersets)

When I run stackdriver-prometheus-sidecar --help, I see:

  --include=INCLUDE ...      PromQL metric and label matcher which must pass for a series to be forwarded to
                             Stackdriver. If repeated, the series must pass any of the filter sets to be
                             forwarded.