cortextool(1)

๐Ÿ“ฆ
version 0.21.1 ยท 2 versions
, in nixpkgs unstable

๐Ÿฆ‹ cortextool(1) โ€” the little CLI that runs your Cortex life ๐Ÿ’…

Okay bestie, settle in, because this is cortextool, from the General Commands Manual, and it's genuinely iconic. It's a whole command-line tool and it's here to help you manage cortex. That's it, that's the vibe. โœจ


๐ŸŒธ NAME ๐ŸŒธ

cortextool โ€” yes, that's the name, that's the whole name, she's confident and she doesn't need a subtitle ๐Ÿ˜Œ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

cortextool [<flags>] <command> [<args> ...]

So it's flags first (optional), then a command (mandatory, main character energy), then whatever args that command wants. Simple. Slay.


๐Ÿ’– DESCRIPTION ๐Ÿ’–

A command-line tool to manage cortex.

That's literally the whole description and honestly? Respect. She said "I do one thing and I do it well." ๐Ÿซถ


โœจ OPTIONS โœจ (the global ones, the ones that go up top)

These are the big-picture flags, the ones that live before your command. Learn them once, use them everywhere. Obsessed.

  • --help โ€” Show context-sensitive help. Also, lowkey, try --help-long and --help-man โ€” she's got range ๐Ÿ’…
  • --config="/homeless-shelter/.cortextool/config" โ€” Path to the cortextool config file. Yes, that default path is real, yes it's giving "nobody's home," no we don't ask questions ๐Ÿ™ˆ
  • --context=CONTEXT โ€” Name of the context to use from the config file. Pick your fighter.
  • --log.level="info" โ€” Sets the level of the logger. Default is "info", obviously.
  • --push-gateway.endpoint=PUSH-GATEWAY.ENDPOINT โ€” The url for the push-gateway to register metrics. Drop that endpoint ๐ŸŽฏ
  • --push-gateway.job=PUSH-GATEWAY.JOB โ€” The job name to register metrics under.
  • --push-gateway.interval=1m โ€” Interval to forward metrics to the push gateway. Default: 1m. Every minute, she checks in. Consistent queen. โฐ

๐Ÿ‘‘ COMMANDS ๐Ÿ‘‘

This is the good part. Buckle up, there's a lot and every single one matters. ๐Ÿ’€

๐Ÿงš help [<command>...]

Show help. That's it. She's helpful, she's humble, she's the friend who actually reads the docs.

๐Ÿ”ฅ alerts verify [<flags>]

Verifies that alerts in an alertmanager cluster are deduplicated. Genuinely useful for verifying your configuration is correct when you're transferring from Prometheus to Cortex alert evaluation. Like a vibe check but for your alerts. ๐Ÿ‘€

  • --ignore-alerts=IGNORE-ALERTS โ€” A comma separated list of Alert names to ignore in deduplication checks. Some alerts just get a pass, ok?
  • --source-label="prometheus" โ€” Label to look for when deciding if two alerts are duplicates of eachother from separate sources. Default: "prometheus".
  • --grace-period=2 โ€” Grace period. Don't consider alert groups with the incorrect amount of alert replicas erroneous unless the alerts have existed for more than this amount of time, in minutes. Default: 2.
  • --frequency=FREQUENCY โ€” Setting this value will turn cortextool into a long-running process, running the alerts verify check every # of minutes specified. She'll just... keep going. Forever. No cap. ๐Ÿ”

๐ŸŒˆ alertmanager get [<flags>]

Get the alertmanager config currently in the cortex alertmanager. Fetch, bestie.

  • --disable-color โ€” disable colored output (sad, but sometimes you gotta, for the pipelines ๐Ÿ˜ญ)

โญ alertmanager delete

Delete the alertmanager config currently in the cortex alertmanager.

Heads up: there's no flags listed for this one, no confirmer, no "are you sure" โ€” just you, your choices, and the consequences ๐Ÿ’€

๐Ÿ“ alertmanager load <config> [<template-files>...]

load a set of rules to a designated cortex endpoint

Takes a <config> and then any number of [<template-files>...]. Load it up, she's carrying. ๐Ÿซถ

๐Ÿฆ‹ rules list [<flags>]

List the rules currently in the cortex ruler. Very "let me see what we're working with" of her.

  • --address=ADDRESS โ€” Address of the cortex cluster, alternatively set CORTEX_ADDRESS or use config file.
  • --id=ID โ€” Cortex tenant id, alternatively set CORTEX_TENANT_ID or use config file.
  • --use-legacy-routes โ€” If set, API requests to cortex will use the legacy /api/prom/ routes, alternatively set CORTEX_USE_LEGACY_ROUTES.
  • --ruler-api-path="" โ€” if set, API requests to cortex will use an alternative path for the ruler API, alternatively set CORTEX_RULER_API_PATH. The default is /api/v1/rules
  • --tls-ca-path="" โ€” TLS CA certificate to verify cortex API as part of mTLS, alternatively set CORTEX_TLS_CA_PATH.
  • --tls-cert-path="" โ€” TLS client certificate to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_CERT_PATH.
  • --tls-key-path="" โ€” TLS client certificate private key to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_KEY_PATH.
  • --format=table โ€” Backend type to interact with: <json|yaml|table>. Default: table.
  • --disable-color โ€” disable colored output

๐Ÿ’œ rules print [<flags>]

Print the rules currently in the cortex ruler. Same energy as list but make it print. ๐Ÿ–จ๏ธ

  • --address=ADDRESS โ€” Address of the cortex cluster, alternatively set CORTEX_ADDRESS or use config file.
  • --id=ID โ€” Cortex tenant id, alternatively set CORTEX_TENANT_ID or use config file.
  • --use-legacy-routes โ€” If set, API requests to cortex will use the legacy /api/prom/ routes, alternatively set CORTEX_USE_LEGACY_ROUTES.
  • --ruler-api-path="" โ€” if set, API requests to cortex will use an alternative path for the ruler API, alternatively set CORTEX_RULER_API_PATH. The default is /api/v1/rules
  • --tls-ca-path="" โ€” TLS CA certificate to verify cortex API as part of mTLS, alternatively set CORTEX_TLS_CA_PATH.
  • --tls-cert-path="" โ€” TLS client certificate to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_CERT_PATH.
  • --tls-key-path="" โ€” TLS client certificate private key to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_KEY_PATH.
  • --disable-color โ€” disable colored output

๐ŸŽฏ rules get [<flags>] <namespace> <group>

Retrieve a rulegroup from the ruler. You give her a namespace and a group, she gives you the goods. ๐Ÿ’…

  • --address=ADDRESS โ€” Address of the cortex cluster, alternatively set CORTEX_ADDRESS or use config file.
  • --id=ID โ€” Cortex tenant id, alternatively set CORTEX_TENANT_ID or use config file.
  • --use-legacy-routes โ€” If set, API requests to cortex will use the legacy /api/prom/ routes, alternatively set CORTEX_USE_LEGACY_ROUTES.
  • --ruler-api-path="" โ€” if set, API requests to cortex will use an alternative path for the ruler API, alternatively set CORTEX_RULER_API_PATH. The default is /api/v1/rules
  • --tls-ca-path="" โ€” TLS CA certificate to verify cortex API as part of mTLS, alternatively set CORTEX_TLS_CA_PATH.
  • --tls-cert-path="" โ€” TLS client certificate to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_CERT_PATH.
  • --tls-key-path="" โ€” TLS client certificate private key to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_KEY_PATH.
  • --disable-color โ€” disable colored output

๐Ÿ’€ rules delete [<flags>] <namespace> <group>

Delete a rulegroup from the ruler. Gone. Poof. She's not asking twice (well, actually, she's not asking at all ๐Ÿ™ˆ).

  • --address=ADDRESS โ€” Address of the cortex cluster, alternatively set CORTEX_ADDRESS or use config file.
  • --id=ID โ€” Cortex tenant id, alternatively set CORTEX_TENANT_ID or use config file.
  • --use-legacy-routes โ€” If set, API requests to cortex will use the legacy /api/prom/ routes, alternatively set CORTEX_USE_LEGACY_ROUTES.
  • --ruler-api-path="" โ€” if set, API requests to cortex will use an alternative path for the ruler API, alternatively set CORTEX_RULER_API_PATH. The default is /api/v1/rules
  • --tls-ca-path="" โ€” TLS CA certificate to verify cortex API as part of mTLS, alternatively set CORTEX_TLS_CA_PATH.
  • --tls-cert-path="" โ€” TLS client certificate to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_CERT_PATH.
  • --tls-key-path="" โ€” TLS client certificate private key to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_KEY_PATH.

๐ŸŒธ rules delete-namespace [<flags>] <namespace>

Delete a namespace from the ruler. Whole namespace. The way she just takes it ALL out ๐Ÿ˜ญ

  • --address=ADDRESS โ€” Address of the cortex cluster, alternatively set CORTEX_ADDRESS or use config file.
  • --id=ID โ€” Cortex tenant id, alternatively set CORTEX_TENANT_ID or use config file.
  • --use-legacy-routes โ€” If set, API requests to cortex will use the legacy /api/prom/ routes, alternatively set CORTEX_USE_LEGACY_ROUTES.
  • --ruler-api-path="" โ€” if set, API requests to cortex will use an alternative path for the ruler API, alternatively set CORTEX_RULER_API_PATH. The default is /api/v1/rules
  • --tls-ca-path="" โ€” TLS CA certificate to verify cortex API as part of mTLS, alternatively set CORTEX_TLS_CA_PATH.
  • --tls-cert-path="" โ€” TLS client certificate to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_CERT_PATH.
  • --tls-key-path="" โ€” TLS client certificate private key to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_KEY_PATH.

๐ŸŒŸ rules load [<flags>] <rule-files>...

load a set of rules to a designated cortex endpoint

Give her one or more <rule-files> and she'll ship them. ๐Ÿš€

  • --address=ADDRESS โ€” Address of the cortex cluster, alternatively set CORTEX_ADDRESS or use config file.
  • --id=ID โ€” Cortex tenant id, alternatively set CORTEX_TENANT_ID or use config file.
  • --use-legacy-routes โ€” If set, API requests to cortex will use the legacy /api/prom/ routes, alternatively set CORTEX_USE_LEGACY_ROUTES.
  • --ruler-api-path="" โ€” if set, API requests to cortex will use an alternative path for the ruler API, alternatively set CORTEX_RULER_API_PATH. The default is /api/v1/rules
  • --tls-ca-path="" โ€” TLS CA certificate to verify cortex API as part of mTLS, alternatively set CORTEX_TLS_CA_PATH.
  • --tls-cert-path="" โ€” TLS client certificate to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_CERT_PATH.
  • --tls-key-path="" โ€” TLS client certificate private key to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_KEY_PATH.

๐Ÿงš rules diff [<flags>] [<rule-files>...]

diff a set of rules to a designated cortex endpoint

She compares. She reports. She does NOT let you push blind. This is the responsible friend of the group and we love her for it. ๐Ÿ’–

  • --address=ADDRESS โ€” Address of the cortex cluster, alternatively set CORTEX_ADDRESS or use config file.
  • --id=ID โ€” Cortex tenant id, alternatively set CORTEX_TENANT_ID or use config file.
  • --use-legacy-routes โ€” If set, API requests to cortex will use the legacy /api/prom/ routes, alternatively set CORTEX_USE_LEGACY_ROUTES.
  • --ruler-api-path="" โ€” if set, API requests to cortex will use an alternative path for the ruler API, alternatively set CORTEX_RULER_API_PATH. The default is /api/v1/rules
  • --tls-ca-path="" โ€” TLS CA certificate to verify cortex API as part of mTLS, alternatively set CORTEX_TLS_CA_PATH.
  • --tls-cert-path="" โ€” TLS client certificate to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_CERT_PATH.
  • --tls-key-path="" โ€” TLS client certificate private key to authenticate with cortex API as part of mTLS, alternatively set CORTEX_TLS_KEY_PATH.
  • --namespaces=NAMESPACES โ€” comma-separated list of namespaces to check during a diff. Cannot be used together with --ignored-namespaces.
  • --ignored-namespaces=IGNORED-NAMESPACES โ€” comma-separated list of namespaces to ignore during a diff. Cannot be used together with --namespaces.
  • --rule-files=RULE-FILES โ€” The rule files to check. Flag can be reused to load multiple files. Reuse it, she doesn't mind ๐Ÿซถ
  • --rule-dirs=RULE-DIRS โ€” Comma separated list of paths to directories containing rules yaml files. Each file in a directory with a .yml or .yaml suffix will be parsed.
  • --disable-color โ€” disable colored output
  • --verbose โ€” show diff output with rules changes
Two things to keep in your cute little head: --namespaces and --ignored-namespaces can NOT be used together, and that's not a suggestion, that's a rule ๐Ÿšซ

and that's literally just part one bestie, she's still going โ€” ๐Ÿ’…

๐ŸŒธ rules sync โ€” push your rules to Cortex

rules sync [<flags>] [<rule-files>...]

okay so this one syncs a whole set of rules to a designated cortex endpoint. bestie, it's the โœจ main character โœจ of the rules workflow imo.

  • --address=ADDRESS โ€” the address of the cortex cluster. you can also set CORTEX_ADDRESS instead, or just use the config file ๐Ÿ’–
  • --id=ID โ€” your Cortex tenant id. alternatively set CORTEX_TENANT_ID, or use the config file ๐Ÿซถ
  • --use-legacy-routes โ€” if set, API requests to cortex will use the legacy /api/prom/ routes. alternatively set CORTEX_USE_LEGACY_ROUTES ๐Ÿฆ‹
  • --ruler-api-path="" โ€” if set, API requests to cortex will use an alternative path for the ruler API, alternatively set CORTEX_RULER_API_PATH. the default is /api/v1/rules ๐Ÿ‘‘
  • --tls-ca-path="" โ€” TLS CA certificate to verify the cortex API as part of mTLS, alternatively set CORTEX_TLS_CA_PATH ๐Ÿ”
  • --tls-cert-path="" โ€” TLS client certificate to authenticate with the cortex API as part of mTLS, alternatively set CORTEX_TLS_CERT_PATH ๐Ÿ”
  • --tls-key-path="" โ€” TLS client certificate private key to authenticate with the cortex API as part of mTLS, alternatively set CORTEX_TLS_KEY_PATH ๐Ÿ”‘
  • --namespaces=NAMESPACES โ€” comma-separated list of namespaces to check during a diff. cannot be used together with --ignored-namespaces ๐Ÿšซ
  • --ignored-namespaces=IGNORED-NAMESPACES โ€” comma-separated list of namespaces to ignore during a sync. cannot be used together with --namespaces ๐Ÿšซ
  • --rule-files=RULE-FILES โ€” the rule files to check. the flag can be reused to load multiple files ๐Ÿ“š
  • --rule-dirs=RULE-DIRS โ€” comma separated list of paths to directories containing rules yaml files. every file in a directory with a .yml or .yaml suffix will be parsed โœจ
lowkey important: --namespaces and --ignored-namespaces are giving sworn enemies โ€” pick one, you literally cannot have both ๐Ÿ’€

๐ŸŽ€ rules prepare โ€” glow-up your aggregations

rules prepare [<flags>] [<rule-files>...]

this one modifies a set of rules by including a specific label in aggregations. it's giving "let me just add a little something" ๐Ÿ’…

  • --rule-files=RULE-FILES โ€” the rule files to check. flag can be reused to load multiple files ๐Ÿ“š
  • --rule-dirs=RULE-DIRS โ€” comma separated list of paths to directories containing rules yaml files. every file in a directory with a .yml or .yaml suffix will be parsed โœจ
  • -i, --in-place โ€” edits the rule file in place. (yes bestie it's literally editing your files, so maybe peek at them first ๐Ÿ™ˆ)
  • -l, --label="cluster" โ€” the label to include as part of the aggregations. default is "cluster" ๐Ÿท๏ธ
  • --label-excluded-rule-groups=LABEL-EXCLUDED-RULE-GROUPS โ€” comma separated list of rule group names to exclude when including the configured label to aggregations ๐Ÿ™…โ€โ™€๏ธ

๐Ÿฆ‹ rules lint โ€” the formatting fairy

rules lint [<flags>] [<rule-files>...]

formats a set of rule files. it reorders keys alphabetically, uses 4 spaces as indentantion, and formats PromQL expressions to a single line. so satisfying, ngl ๐Ÿ˜Œโœจ

  • --rule-files=RULE-FILES โ€” the rule files to check. flag can be reused to load multiple files ๐Ÿ“š
  • --rule-dirs=RULE-DIRS โ€” comma separated list of paths to directories containing rules yaml files. every file in a directory with a .yml or .yaml suffix will be parsed โœจ
  • -n, --dry-run โ€” performs a trial run that doesn't make any changes and (mostly) produces the same outpupt as a real run ๐Ÿ‘€

๐Ÿ”ฅ rules check โ€” bestie behaviour enforcement

rules check [<flags>] [<rule-files>...]

runs various best practice checks against rules. it's the friend who tells you your outfit is cute but your shoes don't match ๐Ÿซถ

  • --rule-files=RULE-FILES โ€” the rule files to check. flag can be reused to load multiple files ๐Ÿ“š
  • --rule-dirs=RULE-DIRS โ€” comma separated list of paths to directories containing rules yaml files. every file in a directory with a .yml or .yaml suffix will be parsed โœจ
  • --strict โ€” fails rules checks that do not match best practices exactly. no notes, no grace, no vibes ๐Ÿ’€

โญ loadgen โ€” the stress-test queen

loadgen [<flags>]

simple load generator for Cortex. she generates. she loads. she serves metrics ๐Ÿ’…

  • --write-url="" โ€” the write URL ๐ŸŒ
  • --series-name="node_cpu_seconds_total" โ€” name of the metric that will be generated โœจ
  • --active-series=1000 โ€” number of active series to send ๐Ÿ”ข
  • --scrape-interval=15s โ€” period to send metrics โฐ
  • --parallelism=10 โ€” how many metrics to send simultaneously ๐Ÿƒโ€โ™€๏ธ
  • --batch-size=100 โ€” how big a batch to send ๐Ÿ“ฆ
  • --write-timeout=500ms โ€” timeout for write requests โณ
  • --query-url="" โ€” the query URL ๐Ÿ”
  • --query="sum(node_cpu_seconds_total)" โ€” query to run ๐Ÿงฎ
  • --query-parallelism=10 โ€” number of queries to run in parallel โšก
  • --query-timeout=20s โ€” timeout for queries โณ
  • --query-duration=1h โ€” length of query ๐Ÿ•
  • --metrics-listen-address=":8080" โ€” address to serve metrics on ๐Ÿ“ก

๐Ÿ’œ remote-read export โ€” take your metrics home

remote-read export --address=ADDRESS [<flags>]

export metrics remote read series into a local TSDB. it's giving "packing up your stuff and moving out" ๐Ÿ“ฆโœจ

  • --address=ADDRESS โ€” address of the cortex cluster, alternatively set $CORTEX_ADDRESS ๐Ÿ’–
  • --remote-read-path="/prometheus/api/v1/read" โ€” path of the remote read endpoint ๐Ÿ›ฃ๏ธ
  • --id="" โ€” Cortex tenant id, alternatively set $CORTEX_TENANT_ID ๐Ÿซถ
  • --key="" โ€” api key to use when contacting cortex, alternatively set $CORTEX_API_KEY ๐Ÿ”‘
  • --read-timeout=30s โ€” timeout for read requests โณ
  • --selector="up" โ€” PromQL selector to filter metrics on. to return all metrics, '{__name__!=""}' can be used ๐ŸŽฏ
  • --from="2026-10-21T20:15:19Z" โ€” start of the time window to select metrics ๐Ÿ“…
  • --to="2026-10-21T21:15:19Z" โ€” end of the time window to select metrics ๐Ÿ“…
  • --tsdb-path="" โ€” path to the folder where to store the TSDB blocks, if not set a new directory in $TEMP is created ๐Ÿ—‚๏ธ

๐ŸŒˆ remote-read dump โ€” spill the tea

remote-read dump --address=ADDRESS [<flags>]

dump remote read series. literally just dumping them out, no filter, no shame ๐Ÿซ—

  • --address=ADDRESS โ€” address of the cortex cluster, alternatively set $CORTEX_ADDRESS ๐Ÿ’–
  • --remote-read-path="/prometheus/api/v1/read" โ€” path of the remote read endpoint ๐Ÿ›ฃ๏ธ
  • --id="" โ€” Cortex tenant id, alternatively set $CORTEX_TENANT_ID ๐Ÿซถ
  • --key="" โ€” api key to use when contacting cortex, alternatively set $CORTEX_API_KEY ๐Ÿ”‘
  • --read-timeout=30s โ€” timeout for read requests โณ
  • --selector="up" โ€” PromQL selector to filter metrics on. to return all metrics, '{__name__!=""}' can be used ๐ŸŽฏ
  • --from="2026-10-21T20:15:19Z" โ€” start of the time window to select metrics ๐Ÿ“…
  • --to="2026-10-21T21:15:19Z" โ€” end of the time window to select metrics ๐Ÿ“…

๐Ÿ“ remote-read stats โ€” the numbers version

remote-read stats --address=ADDRESS [<flags>]

show statistic of remote read series. the way that this just gives you the receipts ๐Ÿ˜ญ๐Ÿ“Š

  • --address=ADDRESS โ€” address of the cortex cluster, alternatively set $CORTEX_ADDRESS ๐Ÿ’–
  • --remote-read-path="/prometheus/api/v1/read" โ€” path of the remote read endpoint ๐Ÿ›ฃ๏ธ
  • --id="" โ€” Cortex tenant id, alternatively set $CORTEX_TENANT_ID ๐Ÿซถ
  • --key="" โ€” api key to use when contacting cortex, alternatively set $CORTEX_API_KEY ๐Ÿ”‘
  • --read-timeout=30s โ€” timeout for read requests โณ
  • --selector="up" โ€” PromQL selector to filter metrics on. to return all metrics, '{__name__!=""}' can be used ๐ŸŽฏ
  • --from="2026-10-21T20:15:19Z" โ€” start of the time window to select metrics ๐Ÿ“…
  • --to="2026-10-21T21:15:19Z" โ€” end of the time window to select metrics ๐Ÿ“…

๐Ÿงš acl generate-header โ€” the golden ticket

acl generate-header --id=ID --rule=RULE

generate the header that needs to be passed to the datasource for setting ACLs. it's giving backstage pass ๐ŸŽซโœจ

  • --id=ID โ€” Cortex tenant ID, alternatively set CORTEX_TENANT_ID ๐Ÿซถ
  • --rule=RULE โ€” the access control rules (Prometheus selectors). set it multiple times to set multiple rules ๐Ÿ”

๐Ÿ’– analyse prometheus โ€” cardinality detective era

analyse prometheus --address=ADDRESS [<flags>]

take the metrics being used in Grafana and get the cardinality from a Prometheus. she investigates ๐Ÿ”๐Ÿ’…

  • --address=ADDRESS โ€” address of the Prometheus/Cortex instance, alternatively set $CORTEX_ADDRESS ๐Ÿ’–
  • --id="" โ€” username to use when contacting Prometheus/Cortex, alternatively set $CORTEX_TENANT_ID ๐Ÿซถ
  • --key="" โ€” password to use when contacting Prometheus/Cortex, alternatively set $CORTEX_API_KEY ๐Ÿ”‘
  • --read-timeout=30s โ€” timeout for read requests โณ
  • --grafana-metrics-file="metrics-in-grafana.json" โ€” the path for the input file containing the metrics from the grafana-analyse command ๐Ÿ“„
  • --ruler-metrics-file="metrics-in-ruler.json" โ€” the path for the input file containing the metrics from the ruler-analyse command ๐Ÿ“„
  • --output="prometheus-metrics.json" โ€” the path for the output file ๐Ÿ“ค

๐ŸŒธ analyse grafana โ€” dashboard archaeology

analyse grafana --address=ADDRESS [<flags>]

analyse and output the metrics used in Grafana Dashboards. bestie we are going digging through dashboards ๐Ÿ”Ž

  • --address=ADDRESS โ€” address of the Grafana instance, alternatively set $GRAFANA_ADDRESS ๐Ÿ’–
  • --key="" โ€” api key to use when contacting Grafana, alternatively set $GRAFANA_API_KEY ๐Ÿ”‘
  • --read-timeout=300s โ€” timeout for read requests โณ
  • --output="metrics-in-grafana.json" โ€” the path for the output file ๐Ÿ“ค

๐ŸŽ€ analyse ruler โ€” rules, but make it metrics

analyse ruler --address=ADDRESS [<flags>]

analyse and extract the metrics used in Cortex rules ๐Ÿง โœจ

  • --address=ADDRESS โ€” address of the Prometheus/Cortex instance, alternatively set $CORTEX_ADDRESS ๐Ÿ’–
  • --id="" โ€” username to use when contacting Prometheus/Cortex, alternatively set $CORTEX_TENANT_ID ๐Ÿซถ
  • --key="" โ€” password to use when contacting Prometheus/Cortex, alternatively set $CORTEX_API_KEY ๐Ÿ”‘
  • --output="metrics-in-ruler.json" โ€” the path for the output file ๐Ÿ“ค

๐Ÿฆ‹ analyse dashboard โ€” feeding it files

analyse dashboard [<flags>] <files>...

analyse and output the metrics used in Grafana dashboard files. you literally hand her the files, she does the rest ๐Ÿ’โ€โ™€๏ธ

  • --output="metrics-in-grafana.json" โ€” the path for the output file ๐Ÿ“ค

๐Ÿ’œ analyse rule-file โ€” same energy, rules version

analyse rule-file [<flags>] <files>...

analyse and output the metrics used in Prometheus rules files ๐Ÿ“œโœจ

  • --output="metrics-in-ruler.json" โ€” the path for the output file ๐Ÿ“ค

๐Ÿ‘‘ bucket-validation โ€” trust but verify

bucket-validation [<flags>]

validate that an object store bucket works correctly. she does a little vibe check on your bucket ๐Ÿชฃโœ…

  • --object-count=2000 โ€” number of objects to create & delete ๐Ÿ”ข
  • --report-every=100 โ€” every X operations a progress report gets printed ๐Ÿ“ˆ
  • --test-runs=1 โ€” number of times we want to run the whole test ๐Ÿ”
  • --prefix="tenant" โ€” path prefix to use for test objects in object store ๐Ÿท๏ธ
  • --retries-on-error=3 โ€” number of times we want to retry if object store returns error ๐Ÿ”„
  • --bucket-config=BUCKET-CONFIG โ€” the CLI args to configure a storage bucket ๐Ÿชฃ
  • --bucket-config-help โ€” help text explaining how to use the -bucket-config parameter ๐Ÿ†˜

โญ config view โ€” see the whole picture

config view

display merged configuration. everything, all at once, merged ๐Ÿซถ


๐ŸŒˆ config get-contexts โ€” roll call

config get-contexts

list all contexts ๐Ÿ“‹


๐Ÿ“ config current-context โ€” where are we rn

config current-context

display the current context ๐Ÿ“


๐Ÿงš config use-context โ€” switch it up

config use-context <name>

set the current context โœจ


๐ŸŽ€ config set-context โ€” build the vibe

config set-context [<flags>] <name>

create or modify a context ๐Ÿ› ๏ธ

  • --cluster=CLUSTER โ€” cluster name for the context ๐Ÿข
  • --user=USER โ€” user name for the context ๐Ÿ‘ค

๐Ÿ’– config set-cluster โ€” cluster era

config set-cluster [<flags>] <name>

create or modify a cluster ๐ŸŒ

  • --address=ADDRESS โ€” Cortex cluster address ๐Ÿ“
  • --tls-ca-path=TLS-CA-PATH โ€” TLS CA certificate path ๐Ÿ”
  • --tls-cert-path=TLS-CERT-PATH โ€” where your TLS client certificate lives, bestie. drop the path and she's ready to show her ID ๐Ÿ’ณ
  • --tls-key-path=TLS-KEY-PATH โ€” and this is the matching TLS client key path. they're a set, don't separate them ๐Ÿ˜ญ
  • --use-legacy-routes โ€” flips you over to the legacy API routes. old school, but sometimes old school is the vibe ๐Ÿซถ
  • --ruler-api-path=RULER-API-PATH โ€” wanna point at a custom ruler API path? say less, that's literally this flag โœจ

๐ŸŽ€ config set-credentials [<flags>] <name>

okay so this one is the moment you create or modify user credentials โ€” yes, both, it's giving multitasking main character energy ๐Ÿ‘‘

  • --id=ID โ€” the Tenant ID. know your tenant, love your tenant ๐Ÿ 
  • --user=USER โ€” your Basic auth username. iconic, essential ๐Ÿชช
  • --key=KEY โ€” the Basic auth password/key that goes with it. guard it with your life, no cap ๐Ÿ”
  • --auth-token=AUTH-TOKEN โ€” a Bearer token for JWT auth. different auth flavor, same slay ๐Ÿ’…

๐Ÿฆ‹ config delete-context <name>

Deletes a context. that's it, that's the whole thing โ€” poof, gone, she's not coming back ๐Ÿ™ˆ


โญ version

Gets the version of the cortextool CLI. tiny command, big "is my stuff up to date" energy ๐Ÿงš


and that's the whole page, bestie โ€” you made it to the end, I'm so proud ๐Ÿ˜ญ๐Ÿ’–

this was cortextool(1) โ€” that's the footer, and yeah, I'm mentioning it in the sign-off because we're cute like that ๐ŸŽ€ go forth and run your commands, you gorgeous nerd ๐Ÿ‘‘โœจ
๐Ÿ“ฆ where this page comes from