Standalone Collector installation to retrieve metrics
Run the Chronosphere Collector as a standalone binary to gather metrics from services that Kubernetes doesn’t manage.
If you don’t use Kubernetes, or want to gather metrics from services not managed by
Kubernetes, you can run the Collector as a standalone binary.
Create an API token
To interact with the Collector, you must
create a service account.
You must be a member of a team with the SysAdmin role to create a new service account.
Cortex XCOR recommends creating a restricted service account with a write-only
scope. Use the generated API token in your Kubernetes Secret to authenticate
with the Collector.
Store your API token in a secure location. If you lose your token, you must create
a new service account.
Download the Collector binary and make it executable
Cortex XCOR supports Chronosphere Collector versions for a year from release. You
can find a full list of versions and release dates in the Chronosphere Collector release notes
located in Cortex XCOR. To view the release notes, in the
navigation menu select
More information > Release notes,
and then click the Collector tab.
Modify the permissions on the binary to make it executable. For example,
to change permissions on the linux-amd64 version of the binary:
chmod +x chronocollector-linux-amd64
Define the Collector configuration file
Download the example configuration file
and modify any configuration values based on your needs.For applicable fields, you can set environment variables instead of specifying them
in the configuration file. For example, to specify the listenAddress, set an
environment variable named ${LISTEN_ADDRESS} with the value you want to use, such
as:
listenAddress: "${LISTEN_ADDRESS:0.0.0.0:3029}"
The following list includes key fields for which you can specify values:
Backend: You must add a gateway backend to specify your XCOR
instance.
Replace TENANT with the name of your Cortex XCOR tenant.
Global Labels: If you don’t need to apply global labels to all metrics, remove
the labels key. If you need global labels and are scraping metrics from a
Prometheus endpoint, you can apply labels to each scrape target.For example, to add host and rack to each metric:
Each Prometheus scrape configuration type has a different way of specifying global
labels. Refer to the Prometheus
scrape configuration documentation
for more details.
Discovery: To scrape a static Prometheus endpoint, configure a scrape setting.
Refer to the Prometheus
service discovery documentation
for more details.
Run the Collector
You can run the Collector standalone with a binary, with Docker, or as a Systemd
service. To run the Collector, pass the configuration file and generated API token.Replace the following values before running the startup commands:
TENANT: The name of your Cortex XCOR tenant.
API_TOKEN: The API token generated from your service account. Cortex XCOR recommends storing your API token in a separate file or Kubernetes Secret and calling it using an environment variable, such as $API_TOKEN.
VERSION: Version of the Collector that you want to run, prefixed with v.
Change the ownership of the directory containing the Collector configuration file.
The following command expects the Collector config.yml file in the
/etc/chronocollector directory: