PCP2GRAPHITE(1)

๐Ÿ’– NAME ๐Ÿ’–

pcp2graphite โ€” the pcp-to-graphite metrics exporter, bestie. That's it, that's the whole job description. ๐Ÿ’…


โœจ SYNOPSIS โœจ

pcp2graphite [-5CGHIjLnrRvV?]  [-4 action] [-8|-9 limit] [-a archive]
[-A align] [--archive-folio folio] [-b|-B space-scale] [-c config]
[--container container] [-D debug] [--daemonize] [-e derived] [-E text-
port] [-g server] [-h host] [-i instances] [-J rank] [-K spec] [-N
predicate] [-O origin] [-p pickle-port] [-P|-0 precision] [-q|-Q count-
scale] [-s samples] [-S starttime] [-t interval] [-T endtime] [-x
prefix] [-X pickle-protocol] [-y|-Y time-scale] metricspec [...]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so real talk: pcp2graphite is a customizable performance metrics exporter tool that ships data from PCP over to Graphite. Any performance metric you can think of โ€” live or archived, system and/or application โ€” can be picked for exporting, and you get to choose it with either command line arguments or a configuration file. so many options, we love choices ๐Ÿ’–

pcp2graphite is a close relative of pmrep(1), like cousins who share a whole personality. Refer to pmrep(1) for the metricspec description accepted on the pcp2graphite command line. And see pmrep.conf(5) for the description of the pcp2graphite.conf configuration file syntax. This page describes pcp2graphite specific options and configuration file differences with pmrep.conf(5). Also, pmrep(1) lists some usage examples, most of which are applicable with pcp2graphite as well. ๐Ÿซถ

Only the command line options listed on this page are supported. Other options available for pmrep(1) are not supported โ€” do not come for them, they're not here. ๐Ÿ’€

Options via environment values (see pmGetOptions(3)) override the corresponding built-in default values (if any). Configuration file options override the corresponding environment variables (if any). Command line options override the corresponding configuration file options (if any). it's giving layers, and the layers matter โœจ

๐ŸŽ€ CONFIGURATION FILE ๐ŸŽ€

pcp2graphite uses a configuration file with syntax described in pmrep.conf(5). The following options are common with pmrep.conf:

version, source, speclocal, derived, header, globals, samples, interval, type, type_prefer, ignore_incompat, names_change, instances, live_filter, rank, limit_filter, limit_filter_force, invert_filter, predicate, omit_flat, precision, precision_force, count_scale, count_scale_force, space_scale, space_scale_force, time_scale, time_scale_force.

The rest of the pmrep.conf options are recognized but ignored for compatibility. (they're there, they just don't do anything, like a group project member ๐Ÿฅฒ)

๐Ÿงš pcp2graphite specific options ๐Ÿงš

  • graphite_host (string) โ€” Specify the destination Graphite server hostname or IP address. Corresponding command line option is -g. Defaults to localhost. ๐Ÿ 
  • graphite_port (integer) โ€” Specify the port number of the Graphite server (plaintext or pickle). Corresponding command line options are -p and -E. Defaults to 2004. ๐Ÿ”Œ
  • pickle (boolean) โ€” Specify whether to use the pickle protocol. Corresponding command line options are -p and -E. Defaults to yes. ๐Ÿฅ’
  • pickle_protocol (integer) โ€” Specify the pickle protocol version. Corresponding command line option is -X. Defaults to 0. ๐Ÿ”ข
  • prefix (string) โ€” Specify the prefix for metrics sent to the server. Corresponding command line option is -x. Defaults to pcp.. ๐Ÿท๏ธ

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

The available command line options are, and yes we're listing every single one, no skips: โœจ

  • -0 precision, --precision-force=precision โ€” Like -P but this option will override per-metric specifications. ๐Ÿ’ช
  • -4 action, --names-change=action โ€” Specify which action to take on receiving a metric names change event during sampling. These events occur when a PMDA discovers new metrics sometime after starting up, and informs running client tools like pcp2graphite. Valid values for action are update (refresh metrics being sampled), ignore (do nothing โ€” the default behaviour) and abort (exit the program if such an event occurs). pick your fighter ๐ŸฅŠ
  • -5, --ignore-unknown โ€” Silently ignore any metric name that cannot be resolved. At least one metric must be found for the tool to start. one survivor minimum, periodt ๐Ÿ™ˆ
  • -8 limit, --limit-filter=limit โ€” Limit results to instances with values above/below limit. A positive integer will include instances with values at or above the limit in reporting. A negative integer will include instances with values at or below the limit in reporting. A value of zero performs no limit filtering. This option will not override possible per-metric specifications. See also -J and -N. ๐Ÿ“‰๐Ÿ“ˆ
  • -9 limit, --limit-filter-force=limit โ€” Like -8 but this option will override per-metric specifications. ๐Ÿ’ฅ
  • -a archive, --archive=archive โ€” Performance metric values are retrieved from the set of Performance Co-Pilot (PCP) archive files identified by the archive argument, which is a comma-separated list of names, each of which may be the base name of an archive or the name of a directory containing one or more archives. ๐Ÿ—‚๏ธ
  • -A align, --align=align โ€” Force the initial sample to be aligned on the boundary of a natural time unit align. Refer to PCPIntro(1) for a complete description of the syntax for align. โฐ
  • --archive-folio=folio โ€” Read metric source archives from the PCP archive folio created by tools like pmchart(1) or, less often, manually with mkaf(1). ๐Ÿ“š
  • -b scale, --space-scale=scale โ€” Unit/scale for space (byte) metrics, possible values include bytes, Kbytes, KB, Mbytes, MB, and so forth. This option will not override possible per-metric specifications. See also pmParseUnitsStr(3). ๐Ÿ“
  • -B scale, --space-scale-force=scale โ€” Like -b but this option will override per-metric specifications. ๐Ÿ’ช
  • -c config, --config=config โ€” Specify the config file or directory to use. In case config is a directory all files in it ending .conf will be included. The default is the first found of: ./pcp2graphite.conf, $HOME/.pcp2graphite.conf, $HOME/pcp/pcp2graphite.conf, and $PCP_SYSCONF_DIR/pcp2graphite.conf. For details, see the above section and pmrep.conf(5). ๐Ÿ”
  • --container=container โ€” Fetch performance metrics from the specified container, either local or remote (see -h). ๐Ÿ“ฆ
  • -C, --check โ€” Exit before reporting any values, but after parsing the configuration and metrics and printing possible headers. a lil sneak peek, then bye ๐Ÿ‘‹
  • --daemonize โ€” Daemonize on startup. ๐ŸŒ€
  • -e derived, --derived=derived โ€” Specify derived performance metrics. If derived starts with a slash (/) or with a dot (.) it will be interpreted as a PCP derived metrics configuration file, otherwise it will be interpreted as comma- or semicolon-separated derived metric expressions. For complete description of derived metrics and PCP derived metrics configuration files see pmLoadDerivedConfig(3) and pmRegisterDerived(3). Alternatively, using pmrep.conf(5) configuration syntax allows defining derived metrics as part of metricsets. ๐Ÿงฎ
In case of issues with derived metrics, review the aforementioned manual pages in detail and ensure all the required metrics are available, especially when using archives. Use -Dderive to see additional debug information about parsing derived metrics. read it fr fr, don't skip ๐Ÿ˜ญ
  • -E port, --text-port=port โ€” Graphite server plaintext port. Using this option disables the pickle protocol. ๐Ÿฅ’๐Ÿšซ
  • -g server, --graphite-host=server โ€” Destination Graphite server hostname or IP address. ๐ŸŒ
  • -G, --no-globals โ€” Do not include global metrics in reporting (see pmrep.conf(5)). ๐Ÿšซ๐ŸŒ
  • -h host, --host=host โ€” Fetch performance metrics from pmcd(1) on host, rather than from the default localhost. ๐Ÿ–ฅ๏ธ
  • -H, --no-header โ€” Do not print any headers. โœ‚๏ธ
  • -i instances, --instances=instances โ€” Retrieve and report only the specified metric instances. By default all instances, present and future, are reported. ๐Ÿ‘ฏ

Refer to pmrep(1) for complete description of this option. ๐Ÿ“–

  • -I, --ignore-incompat โ€” Ignore incompatible metrics. By default incompatible metrics (that is, their type is unsupported or they cannot be scaled as requested) will cause pcp2graphite to terminate with an error message. With this option all incompatible metrics are silently omitted from reporting. This may be especially useful when requesting non-leaf nodes of the PMNS tree for reporting. ๐Ÿซฅ
  • -j, --live-filter โ€” Perform instance live filtering. This allows capturing all named instances even if processes are restarted at some point (unlike without live filtering). Performing live filtering over a huge number of instances will add some internal overhead so a bit of user caution is advised. See also -n. โš ๏ธ
  • -J rank, --rank=rank โ€” Limit results to highest/lowest ranked instances of set-valued metrics. A positive integer will include highest valued instances in reporting. A negative integer will include lowest valued instances in reporting. A value of zero performs no ranking. Ranking does not imply sorting, see -6. See also -8. ๐Ÿ†
  • -K spec, --spec-local=spec โ€” When fetching metrics from a local context (see -L), the -K option may be used to control the DSO PMDAs that should be made accessible. The spec argument conforms to the syntax described in pmSpecLocalPMDA(3). More than one -K option may be used. ๐Ÿงฉ
  • -L, --local-PMDA โ€” Use a local context to collect metrics from DSO PMDAs on the local host without PMCD. See also -K. ๐Ÿก
  • -n, --invert-filter โ€” Perform ranking before live filtering. By default instance live filtering (when requested, see -j) happens before instance ranking (when requested, see -J). With this option the logic is inverted and ranking happens before live filtering. ๐Ÿ”„
  • -N predicate, --predicate=predicate โ€” Specify a comma-separated list of predicate filter reference metrics. By default ranking (see -J) happens for each metric individually. With predicates, ranking is done only for the specified predicate metrics. When reporting, rest of the metrics sharing the same instance domain (see PCPIntro(1)) as the predicate will include only the highest/lowest ranking instances of the corresponding predicate. Ranking does not imply sorting, see -6. ๐ŸŽฏ

So for example, using proc.memory.rss (resident memory size of process) as the predicate metric together with proc.io.total_bytes and mem.util.used as metrics to be reported, only the processes using most/least (as per -J) memory will be included when reporting total bytes written by processes. Since mem.util.used is a single-valued metric (thus not sharing the same instance domain as the process related metrics), it will be reported as usual. ๐ŸŒธ

  • -O origin, --origin=origin โ€” okay so when you're reporting archived metrics, this says start here at origin inside the time window (peep -S and -T for that window, bestie). The full tea on what origin can look like lives in PCPIntro(1). โœจ
  • -p port, --pickle-port=port โ€” this is the Graphite server's pickle port. The moment you use this option, boom, the pickle protocol is switched on. ๐Ÿฅ’
  • -P precision, --precision=precision โ€” sets precision for numeric non-integer output values. Default vibe is 3 decimal places (when it even applies). Heads up tho: this will not override any per-metric specifications that might already be in play. ๐Ÿ’…
  • -q scale, --count-scale=scale โ€” unit/scale for count metrics. Possible values include count x 10^-1, count, count x 10, count x 10^2, and so on and so forth, all the way from 10^-8 to 10^7. (ngl these values are currently space-sensitive, so watch those spaces.) This one will not override possible per-metric specifications either. See also pmParseUnitsStr(3). ๐ŸŒˆ
  • -Q scale, --count-scale-force=scale โ€” literally like -q except this one will override per-metric specifications. Forceful. Main character. ๐Ÿ‘‘
  • -r, --raw โ€” outputs raw metric values, so no converting cumulative counters into rates. This option will override possible per-metric specifications. raw is raw fr fr. ๐Ÿ”ฅ
  • -R, --raw-prefer โ€” like -r but softer โ€” this one will not override per-metric specifications. It's giving "raw if you want it, no pressure". ๐Ÿซถ
  • -s samples, --samples=samples โ€” samples is how many samples get retrieved and reported. If samples is 0, or if you just don't pass -s at all, then pcp2graphite will sample and report continuously (that's real time mode) or until it hits the end of the set of PCP archives (that's archive mode). See also -T. ๐Ÿ’–
  • -S starttime, --start=starttime โ€” when you're reporting archived metrics, the report gets restricted to only those records logged at or after starttime. The full syntax tea for starttime is in PCPIntro(1). โญ
  • -t interval, --interval=interval โ€” sets the reporting interval to something other than the default 1 second. The interval argument follows the syntax described in PCPIntro(1), and in its simplest form it can just be an unsigned integer (in which case the implied units are seconds, easy). See also the -T option. ๐ŸŽ€
  • -T endtime, --finish=endtime โ€” when reporting archived metrics, the report is restricted to records logged before or at endtime. Full syntax deets for endtime? PCPIntro(1), obviously. ๐Ÿ’œ

When this is used to define the runtime before pcp2graphite exits, and if no samples is given (see -s), then the number of reported samples depends on interval (see -t). If samples is given, then interval gets adjusted so it can report samples during the runtime. And if you give all three of -T, -s, and -t? Then endtime is what determines the actual time pcp2graphite will run. periodt. โฐ

  • -v, --omit-flat โ€” reports only set-valued metrics with instances (like disk.dev.read) and omits those single-valued ``flat'' metrics without instances (like kernel.all.sysfork). See -i and -I. ๐Ÿฆ‹
  • -V, --version โ€” displays the version number and dips. bye bestie ๐Ÿ‘‹
  • -x prefix, --prefix=prefix โ€” metrics prefix for the measurements sent to the server. โœจ
  • -X protocol, --pickle-protocol=protocol โ€” the pickle protocol version number. ๐Ÿฅ’
  • -y scale, --time-scale=scale โ€” unit/scale for time metrics. Possible values include nanosec, ns, microsec, us, millisec, ms, and so forth all the way up to hour, hr. This will not override possible per-metric specifications. See also pmParseUnitsStr(3). ๐ŸŒธ
  • -Y scale, --time-scale-force=scale โ€” like -y but this one will override per-metric specifications. boss energy. ๐Ÿ’…
  • -?, --help โ€” displays the usage message and exits. the classic. ๐Ÿ™ˆ

๐ŸŒธ FILES ๐ŸŒธ

  • pcp2graphite.conf โ€” the pcp2graphite configuration file (see -c). ๐ŸŽ€
  • $PCP_SYSCONF_DIR/pmrep/*.conf โ€” system provided default pmrep configuration files. โœจ

๐ŸŒˆ PCP ENVIRONMENT ๐ŸŒˆ

Environment variables with the prefix PCP_ are used to parameterize the file and directory names that PCP uses. On every installation, the file /etc/pcp.conf contains the local values for these variables. And the $PCP_CONF variable can be used to specify an alternative configuration file, as described in pcp.conf(5). ๐Ÿ’–

For environment variables that affect PCP tools, see pmGetOptions(3).

Of particular note: PCP_DISCRETE_ONCE can be set to ensure that discrete metric values are reported only once, unless they change at some point. ๐Ÿ‘€

๐Ÿ’€ DEBUGGING OPTIONS ๐Ÿ’€

The -D or --debug option enables the output of additional diagnostics on stderr to help triage problems, although lowkey the information is sometimes cryptic and primarily intended to provide guidance for developers rather than for end-users. debug is a comma separated list of debugging options; use pmdbg(1) with the -l option to obtain a list of the available debugging options and what they mean. ๐Ÿงš


โญ SEE ALSO โญ

PCPIntro(1), mkaf(1), pcp(1), pcp2elasticsearch(1), pcp2influxdb(1), pcp2json(1), pcp2spark(1), pcp2xlsx(1), pcp2xml(1), pcp2zabbix(1), pmcd(1), pminfo(1), pmrep(1), pmGetOptions(3), pmLoadDerivedConfig(3), pmParseUnitsStr(3), pmRegisterDerived(3), pmSpecLocalPMDA(3), LOGARCHIVE(5), pcp.conf(5), pmrep.conf(5) and PMNS(5). ๐ŸŒˆ


and that's the whole page, bestie!! ๐Ÿ’–โœจ

This one came from Performance Co-Pilot โ€” the PCP girlies โ€” and it's the PCP2GRAPHITE(1) manual page. go forth and graphite your metrics, you absolute icon. ๐ŸŽ€๐Ÿฆ‹๐Ÿ’…๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from