PCP-GEOLOCATE(1)

πŸ“¦
version 7.2.2 Β· 2 versions
, in arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– pcp-geolocate β€” a Gen Z field guide πŸ’–

okay bestie, welcome to pcp-geolocate, a page from the General Commands Manual section of the Performance Co-Pilot docs. it's a whole vibe and it's lowkey about finding out where in the world your collector host actually is 🌍✨


🌸 NAME 🌸

pcp-geolocate β€” discover collector system geographical labels πŸ’…


✨ SYNOPSIS ✨

pcp geolocate

that's it. that's the whole thing. no flags, no drama, she just goes 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: pcp-geolocate reports the latitude and longitude for the local Performance Co-Pilot collector host, and it spits it out in JSON format. very demure, very parseable. 😌

where does that geolocation info come from? two possibilities, and she's got a priority order:

  1. the cache file $PCP_SYSCONF_DIR/labels/optional/geolocate β€” if it exists, that's the source, periodt.
  2. if that file doesn't exist, she'll make an attempt to perform geolocation based on the host IP address, via several online sources (REST APIs). yes bestie, she's going online for this one 🌐

the output from this command is literally made for storing as metric labels β€” you just save it to that cache file mentioned above and you're golden. πŸ’Ύβœ¨

also!! the opt-in systemd(1) service unit file for this command provides an automated location discovery for PCP metric labels. so it can just... do it for you. iconic behaviour, no notes πŸ‘‘


πŸŽ€ METRIC LABELS πŸŽ€

the JSON output is the preferred format for storing geographical location as PCP metric labels. why? because every PCP metric available from this host will be tagged with the labels for latitude and longitude β€” which means tools that make use of this, like the Grafana geomap panel, get to shine. πŸ“πŸ—ΊοΈ

for more information about metric labels, go read the pmcd(1), pminfo(1), pmlogger(1) and pmLookupLabels(3) manual entries. iykyk, they're the receipts πŸ“š


🌈 PCP ENVIRONMENT 🌈

environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. on each installation, the file /etc/pcp.conf contains the local values for these variables. πŸ“

and the $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5). so if you wanna be extra, you absolutely can πŸ’β€β™€οΈ


πŸ‘‘ SEE ALSO πŸ‘‘

PCPIntro(1), pmcd(1), pminfo(1), pmseries(1), pmlogger(1), systemd(1), pmLookupLabels(3), pcp.conf(5) and pcp.env(5).

go forth and read, bestie, the rabbit hole is deep and it's giving knowledge πŸ’œ


mwah, that's a wrap 🫢 this whole thing came to you straight from the Performance Co-Pilot crew, under the PCP banner β€” thanks for reading, you ate that πŸ’…βœ¨

πŸ“¦ where this page comes from