PCP2OPENMETRICS(1)
π PCP2OPENMETRICS π
okay bestie, welcome to pcp2openmetrics(1) β the general commands manual page, but make it cute. this is the pcp-to-openmetrics exporter and she is serving β¨
πΈ NAME πΈ
pcp2openmetrics β pcp-to-openmetrics exporter
π SYNOPSIS π
pcp2openmetrics [-5CEGHIjLmnrRvVxXz?] [-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]
[-f format] [-F outfile] [-h host] [-i instances] [-J rank] [-K spec]
[-N predicate] [-o timeout] [-O origin] [-p password] [-P|-0 precision]
[-q|-Q count-scale] [-s samples] [-S starttime] [-t interval] [-T
endtime] [-u url] [-U username] [-y|-Y time-scale] [-Z timezone]
metricspec [...]
π¦ DESCRIPTION π¦
okay so pcp2openmetrics is a customizable performance metrics exporter tool that takes stuff from PCP and turns it into Open Metrics format β that's https://openmetrics.io btw, iykyk. any available performance metric β live or archived, system and/or application β can be selected for exporting, either through command line arguments or through a configuration file. pick your fighter π
pcp2openmetrics is a close relative of pmrep(1). so if you wanna know what metricspec even means on the command line here, go read pmrep(1) β she explains it. and for the pcp2openmetrics.conf configuration file syntax, pmrep.conf(5) has you covered. this page right here is describing the stuff that's pcp2openmetrics specific plus how the config file differs from pmrep.conf(5). also pmrep(1) lists some usage examples and most of them work with pcp2openmetrics too, so go peek π
only the command line options listed on this page are supported, bestie. other options that exist for pmrep(1)? not supported here. periodt.
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 hierarchy, it's giving β¨ precedence β¨
π CONFIGURATION FILE π
pcp2openmetrics uses a configuration file with syntax described in pmrep.conf(5). these options are the ones she 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, include_labels, 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? they get recognized but ignored for compatibility. they're just there for the vibes π«Ά
π pcp2openmetrics specific options
everything(boolean) β write everything known about metrics, including PCP internal IDs. labels are, however, omitted for backward compatibility. enableinclude_labelsto include them as well. corresponding command line option is-X. defaults tono.exact_types(boolean) β write numbers as number data types, not as strings, potentially losing some precision. corresponding command line option is-E. defaults tono.url(string) β send OPENMETRICS output as a HTTP POST to the given url. corresponding command line option is-u. defaults toNone.http_pass(string) β use given password for Basic Authentication when sending a HTTP POST. corresponding command line option is-p. defaults toNone.http_user(string) β use given username for Basic Authentication when sending a HTTP POST. corresponding command line option is-U. defaults toNone.http_timeout(number) β maximum time (in seconds) when sending a HTTP POST. corresponding command line option is-o. defaults to2.5seconds.no-comment(boolean) β omit# PCP5comment line. omits header for some metric data such as type, instance domain, and semantics. corresponding command line option is-x. defaults tono.
β¨ OPTIONS β¨
the available command line options are:
-0precision,--precision-force=precision β like-Pbut this option will override per-metric specifications.-4action,--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 likepcp2openmetrics. valid values for action areupdate(refresh metrics being sampled),ignore(do nothing β this is the default behaviour) andabort(exit the program if such an event occurs).-5,--ignore-unknownβ silently ignore any metric name that cannot be resolved. at least one metric must be found for the tool to start.-8limit,--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-Jand-N.-9limit,--limit-filter-force=limit β like-8but this option will override per-metric specifications. she's the forceful one π-aarchive,--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.-Aalign,--align=align β force the initial sample to be aligned on the boundary of a natural time unit align. refer toPCPIntro(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 likepmchart(1)or, less often, manually withmkaf(1).-bscale,--space-scale=scale β unit/scale for space (byte) metrics, possible values includebytes,Kbytes,KB,Mbytes,MB, and so forth. this option will not override possible per-metric specifications. see alsopmParseUnitsStr(3).-Bscale,--space-scale-force=scale β like-bbut this option will override per-metric specifications.-cconfig,--config=config β specify the config file or directory to use. in case config is a directory, all files in it ending.confwill be included. the default is the first found of:./pcp2openmetrics.conf,$HOME/.pcp2openmetrics.conf,$HOME/pcp/pcp2openmetrics.conf, and$PCP_SYSCONF_DIR/pcp2openmetrics.conf. for details, see the above section andpmrep.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. she's just here to check, not to spill β--daemonizeβ daemonize on startup.-ederived,--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 seepmLoadDerivedConfig(3)andpmRegisterDerived(3). alternatively, usingpmrep.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.
-E,--exact-typesβ write numbers as number data types, not as strings, potentially losing some precision.-fformat,--timestamp-format=format β use the format string for formatting the timestamp. the format will be used with Python'sdatetime.strftimemethod which is mostly the same as that described instrftime(3). the default is%Y-%m-%d %H:%M:%S.-Foutfile,--output-file=outfile β specify the output file outfile.-G,--no-globalsβ do not include global metrics in reporting (seepmrep.conf(5)).-hhost,--host=host β fetch performance metrics frompmcd(1)on host, rather than from the default localhost.-iinstances,--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 causepcp2openmetricsto 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.-Jrank,--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.-Kspec,--spec-local=spec β when fetching metrics from a local context (see-L), the-Koption may be used to control the DSO PMDAs that should be made accessible. the spec argument conforms to the syntax described inpmSpecLocalPMDA(3). more than one-Koption may be used.-l,--timesβ live timestamp mode. when configured, metric values are accompanied by their respective timestamp.-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.-m,--include-labelsβ include PCP metric labels in the output.
-N predicate, --predicate=predicate β okay so this is the tea β. You give a comma-separated list of predicate filter reference metrics. By default, ranking (see -J) happens for each metric individually. But 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 like, 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, --http-timeout β timeout (in seconds) when sending a HTTP POST with the -u option. Default value is 2.5 seconds. β±οΈ
-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, --http-pass β password when using HTTP basic authentication with the -u option. π
-P precision, --precision=precision β use precision for numeric non-integer output values. The default is to use 3 decimal places (when applicable). This option will not override possible per-metric specifications. π’
-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 forth from 10^-8 to 10^7. (These values are currently space-sensitive, so watch those spaces! π) This option will not override possible per-metric specifications. See also pmParseUnitsStr(3). π
-Q scale, --count-scale-force=scale β like -q but this option 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 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, pcp2openmetrics 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 pcp2openmetrics 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 pcp2openmetrics will run. π
-u, --url β URL for sending an HTTP POST (instead of default standard output). π
-U, --http-user β username when using HTTP basic authentication with the -u option. π€
-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. π·οΈ
-x, --no-comment β omit # PCP5 comment line. π€
-X, --with-everything β write everything known about metrics, including PCP internal IDs. Labels are, however, omitted for backward compatibility, use -m to include them as well. π¦
-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. π₯
-z, --hostzone β use the local timezone of the host that is the source of the performance metrics, as identified by either the -h or the -a options. The default is to use the timezone of the local host. π
-Z timezone, --timezone=timezone β use timezone for the date and time. Timezone is in the format of the environment variable TZ as described in environ(7). Note that when including a timezone string in output, ISO 8601-style UTC offsets are used (so something like -Z EST+5 will become UTC-5). π°οΈ
-?, --help β display usage message and exit. π
π FILES π
pcp2openmetrics.confβpcp2openmetricsconfiguration file (see-c) π$PCP_SYSCONF_DIR/pmrep/*.confβ system provided defaultpmrepconfiguration 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), pcp2influxdb(1), pcp2spark(1), pcp2xlsx(1), pcp2xml(1), pcp2json(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), PMNS(5) and environ(7). π
This masterpiece was brought to you by Performance Co-Pilot, PCP, and PCP2OPENMETRICS(1). Date? It's giving timeless, bestie. πβ¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu stonking: pcp 7.2.1-2build1
- Copyright (C) 2024 Lauren Chilton <lchilton@redhat.com>
- Copyright (C) 2024 Red Hat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms