PCP2INFLUXDB(1)

πŸ’– pcp2influxdb β€” like, the pcp-to-influxdb metrics exporter πŸ’–

okay bestie, so this is the PCP2INFLUXDB(1) page, from the General Commands Manual section, and honestly? it's a whole vibe. it's long, so we're doing this in parts. part 1, let's go 🫢


✨ NAME ✨

pcp2influxdb β€” the pcp-to-influxdb metrics exporter, no cap πŸ’…


🌸 SYNOPSIS 🌸

pcp2influxdb [-CGHIjLnrRvV?]  [-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
password] [-g server] [-h host] [-i instances] [-J rank] [-K spec] [-N
predicate] [-O origin] [-P|-0 precision] [-q|-Q count-scale] [-s
samples] [-S starttime] [-t interval] [-T endtime] [-U username] [-x
database] [-X tags] [-y|-Y time-scale] metricspec [...]

like, that's the whole shape of the command. flags go brrr ⭐


πŸ¦‹ DESCRIPTION πŸ¦‹

pcp2influxdb is a customizable performance metrics exporter tool that goes from PCP to InfluxDB. literally any available performance metric β€” live or archived, system and/or application β€” can be picked for exporting, and you can do the picking either with command line arguments or with a configuration file. iconic behavior honestly πŸ‘‘

pcp2influxdb is a close relative of pmrep(1). so if you wanna know about the metricspec description that pcp2influxdb accepts on its command line β€” go read pmrep(1), bestie, it's all there. and for the description of the pcp2influxdb.conf configuration file syntax, see pmrep.conf(5). this page right here is only about the stuff that's specific to pcp2influxdb and the ways its config file differs from pmrep.conf(5). pmrep(1) also lists some usage examples, and most of those work with pcp2influxdb too πŸ’–

only the command line options listed on this page are supported. other options that exist for pmrep(1)? not supported. periodt.

okay and here's the hierarchy of who-wins, and it matters:

  • 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).

so it's env beats defaults, config beats env, command line beats everything. the main character always wins πŸ’…


πŸŽ€ CONFIGURATION FILE πŸŽ€

pcp2influxdb uses a configuration file with syntax described in pmrep.conf(5).

these options are the ones it has in 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

and the rest of the pmrep.conf options? they're recognized but ignored, purely for compatibility. like they're at the party but they're not dancing 🫢

πŸ’œ pcp2influxdb specific options πŸ’œ

influx_server (string)

Specify the destination InfluxDB server. the corresponding command line option is -g. defaults to http://127.0.0.1:8086. ✨

influx_db (string)

Specify the metrics database. the corresponding command line option is -x. defaults to pcp.

influx_user (string)

Specify the username for the database. the corresponding command line option is -U. Undefined by default β€” meaning no authentication is attempted.

influx_pass (string)

Specify the password for the database. the corresponding command line option is -E. Undefined by default β€” meaning no authentication is attempted.

influx_tags (string)

Specify string of tags to add to the metrics. the corresponding command line option is -X. Undefined by default.


✨ OPTIONS ✨

the available command line options are, and yes we're doing all of them, buckle up:

  • -0 precision, --precision-force=precision β€” like -P but this one will override per-metric specifications. it's giving "I said what I said" πŸ’…
  • -4 action, --names-change=action β€” specify which action to take on receiving a metric names change event during sampling. these events happen when a PMDA discovers new metrics sometime after starting up, and then informs running client tools like pcp2influxdb. valid values for action are:
    • update β€” refresh metrics being sampled
    • ignore β€” do nothing, and this is the default behaviour
    • abort β€” exit the program if such an event occurs 😭
  • -5, --ignore-unknown β€” silently ignore any metric name that cannot be resolved. but heads up: at least one metric must be found for the tool to start. so it can't be all ghosts πŸ‘»
  • -8 limit, --limit-filter=limit β€” limit results to instances with values above/below limit. a positive integer includes instances with values at or above the limit in reporting. a negative integer includes 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. forceful queen πŸ‘‘
  • -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). very "crafted by hand" energy πŸŽ€
  • -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: ./pcp2influxdb.conf, $HOME/.pcp2influxdb.conf, $HOME/pcp/pcp2influxdb.conf, and $PCP_SYSCONF_DIR/pcp2influxdb.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. it's the "just checking, not committing" option πŸ™ˆ
  • --daemonize β€” daemonize on startup. bye bestie, you live in the background now πŸ‘‹
  • -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 a 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.

and if you're having issues with derived metrics: review those manual pages in detail and make sure all the required metrics are available, especially when using archives. use -Dderive to see additional debug information about parsing derived metrics. πŸ”₯

  • -E password, --db-pass=password β€” specify the database password. 🀫
  • -g server, --db-server=server β€” destination InfluxDB server.
  • -G, --no-globals β€” do not include global metrics in reporting (see pmrep.conf(5)). we're going local-only, periodt.
  • -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. minimalism, we love her ✨
  • -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 a 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 pcp2influxdb 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). but 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. stack 'em up πŸ’…
  • -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. flipping the script πŸ”„
  • -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, the 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. and 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. see, it all makes sense 🌟

  • -O origin, --origin=origin β€” when reporting archived metrics, start reporting at origin within the time window (see -S and -T). refer to PCPIntro(1) for a complete description of the syntax for origin.
  • -P precision, --precision=precision β€” bestie, this one sets the precision for your numeric non-integer output values ✨. Default vibe is 3 decimal places (when applicable, okay, when applicable). Heads up tho: this will not override any per-metric specifications, so don't come for me when your custom metrics do their own thing πŸ’….
  • -q scale, --count-scale=scale β€” unit/scale for your count metrics πŸŽ€. Possible values include count x 10^-1, count, count x 10, count x 10^2, and so forth from 10^-8 to 10^7. Not me warning you: (these values are currently space-sensitive 🫠). This option will not override possible per-metric specifications. See also pmParseUnitsStr(3).
  • -Q scale, --count-scale-force=scale β€” like -q but this one is giving main character energy and will override per-metric specifications πŸ‘‘.
  • -r, --raw β€” output raw metric values, do not convert cumulative counters to rates. This option will override possible per-metric specifications πŸ”₯.
  • -R, --raw-prefer β€” like -r but lowkey respectful: this option will not override per-metric specifications 🌸.
  • -s samples, --samples=samples β€” the samples argument defines the number of samples to be retrieved and reported πŸ“Š. If samples is 0 or -s is not specified, pcp2influxdb will sample and report continuously (in real time mode) or until the end of the set of PCP archives (in archive mode). See also -T.
  • -S starttime, --start=starttime β€” when reporting archived metrics, the report will be restricted to those records logged at or after starttime ⏰. Refer to PCPIntro(1) for a complete description of the syntax for starttime.
  • -t interval, --interval=interval β€” set the reporting interval to something other than the default 1 second. The interval argument follows the syntax described in PCPIntro(1), and in the simplest form may be an unsigned integer (the implied units in this case are seconds). See also the -T option πŸ’«.
  • -T endtime, --finish=endtime β€” when reporting archived metrics, the report will be restricted to those records logged before or at endtime. Refer to PCPIntro(1) for a complete description of the syntax for endtime.

When used to define the runtime before pcp2influxdb will exit, if no samples is given (see -s) then the number of reported samples depends on interval (see -t). If samples is given then interval will be adjusted to allow reporting of samples during runtime. In case all of -T, -s, and -t are given, endtime determines the actual time pcp2influxdb will run πŸ•.

  • -U username, --db-user=username β€” specify the database username πŸ”.
  • -v, --omit-flat β€” report only set-valued metrics with instances (e.g. disk.dev.read) and omit single-valued ``flat'' metrics without instances (e.g. kernel.all.sysfork) πŸ™ˆ. See -i and -I.
  • -V, --version β€” display version number and exit. slay πŸ’–
  • -x database, --db-name=database β€” specify the metrics database name πŸ—„οΈ.
  • -X tags, --db-tags=tags β€” specify strings of tags to add to the metrics 🏷️.
  • -y scale, --time-scale=scale β€” unit/scale for time metrics πŸ•°οΈ, possible values include nanosec, ns, microsec, us, millisec, ms, and so forth up to hour, hr. This option will not override possible per-metric specifications. See also pmParseUnitsStr(3).
  • -Y scale, --time-scale-force=scale β€” like -y but this option will override per-metric specifications πŸ‘‘.
  • -?, --help β€” display usage message and exit 🫢.

🌈 FILES 🌈

  • pcp2influxdb.conf β€” pcp2influxdb 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 used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5) ✨.

For environment variables affecting 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 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 their meaning πŸ”.


πŸ‘€ SEE ALSO πŸ‘€

PCPIntro(1), mkaf(1), pcp(1), pcp2elasticsearch(1), pcp2graphite(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 a wrap bestie πŸ’– this page is brought to you by Performance Co-Pilot (that's the source, and it's the PCP version, iykyk), filed under PCP2INFLUXDB(1) β€” go forth and pipe your metrics, you absolute icon πŸŽ€βœ¨πŸ¦‹
πŸ“¦ where this page comes from