PCP2ELASTICSEARCH(1)
๐ PCP2ELASTICSEARCH(1) ๐ โ General Commands Manual
okay bestie, gather round, because this is the manual page for pcp2elasticsearch and it's a whole vibe ๐ฆ. It's a section 1 command, it lives with the general commands, and it is so much more chill than it looks. Let's get into it. โจ
๐ธ NAME ๐ธ
pcp2elasticsearch โ the pcp-to-elasticsearch metrics exporter. that's it, that's the name, and honestly? iconic. ๐
โจ SYNOPSIS โจ
pcp2elasticsearch [-5CGHIjLmnrRvV?] [-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]
[-g URL] [-h host] [-i instances] [-J rank] [-K spec] [-N predicate] [-O
origin] [-p type] [-P|-0 precision] [-q|-Q count-scale] [-s samples] [-S
starttime] [-t interval] [-T endtime] [-x index] [-X hostid] [-y|-Y
time-scale] metricspec [...]
yes there are a LOT of flags. yes we're going to go through every single one. no we are not skipping any. ๐ซถ
๐ DESCRIPTION ๐
pcp2elasticsearch is your customizable performance metrics exporter bestie, moving things from PCP over to Elasticsearch. Any available performance metric โ live or archived, system and/or application โ can be picked for exporting, and you get to choose it either with command line arguments or a configuration file. your call, queen. ๐
pcp2elasticsearch is a close relative of pmrep(1) โ like, literally cousins. So go read pmrep(1) for the description of the metricspec that's accepted on the pcp2elasticsearch command line. And see pmrep.conf(5) for the description of the pcp2elasticsearch.conf configuration file syntax. This page right here is all about the stuff that's specific to pcp2elasticsearch and the ways its config file differs from pmrep.conf(5). Oh and pmrep(1) also has some usage examples, most of which work just as well with pcp2elasticsearch. slay.
โ ๏ธ Only the command line options listed on this page are supported, okay? The other options that exist for pmrep(1)? Not supported here. sorry not sorry. ๐
Now the precedence tea, because this 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). And command line options override the corresponding configuration file options (if any). It's a whole hierarchy and command line is the main character. ๐
๐ CONFIGURATION FILE ๐
pcp2elasticsearch 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, 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 are recognized but ignored, purely for compatibility. they're just there vibing in the background. ๐
๐ pcp2elasticsearch specific options ๐
es_server(string) โ Specify the destination Elasticsearch server metric URL. Corresponding command line option is-g. Defaults tohttp://localhost:9200/. ๐es_auth(string) โ Specify the user name to use with Elasticsearch requests. Defaults to none. ngl, "none" is a mood.es_password(string) โ Specify the pass word to use with Elasticsearch requests. Defaults to none. keep it secret, keep it safe bestie. ๐es_index(string) โ Specify the Elasticsearch index for metric names. Corresponding command line option is-x. Defaults topcp. ๐es_hostid(string) โ Specify the Elasticsearch host-id for measurements. Corresponding command line option is-X. Defaults to the metrics source host. ๐ฅ๏ธes_search_type(string) โ Specify the Elasticsearch search type for measurements. Corresponding command line option is-p. Defaults topcp-metric. ๐
โจ OPTIONS โจ
The available command line options are, in order, all of them, no skipping, we're doing this: ๐
-0precision,--precision-force=precision โ Like-Pbut this option will override per-metric specifications. forceful. bold. love that for it.-4action,--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 likepcp2elasticsearch. Valid values for action areupdate(refresh metrics being sampled),ignore(do nothing โ the default behaviour) andabort(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. so like, it can ghost some metrics but not all of them. ๐-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. it does not ask permission. โจ-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. throwback metrics, we love to see it. ๐ผ-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. so satisfying when things line up. ๐--archive-folio=folio โ Read metric source archives from the PCP archive folio created by tools likepmchart(1)or, less often, manually withmkaf(1). fancy. ๐-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. no cap. ๐-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:./pcp2elasticsearch.conf,$HOME/.pcp2elasticsearch.conf,$HOME/pcp/pcp2elasticsearch.conf, and$PCP_SYSCONF_DIR/pcp2elasticsearch.conf. For details, see the above section andpmrep.conf(5). it goes looking for you, that's devotion. ๐ฅน--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 giving "just checking, not committing". โ--daemonizeโ Daemonise on startup. disappear into the background, mysterious icon. ๐-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. ๐งฎ
-gURL,--es-host=URL โ Destination Elasticsearch server metric URL. ๐ก-G,--no-globalsโ Do not include global metrics in reporting (seepmrep.conf(5)). globals? not today. ๐ซ-hhost,--host=host โ Fetch performance metrics frompmcd(1)on host, rather than from the defaultlocalhost. go explore bestie. ๐-H,--no-headerโ Do not print any headers. minimalism era. โจ-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 causepcp2elasticsearchto 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. let them go, they weren't your vibe anyway. ๐-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. stack 'em. ๐งฑ-L,--local-PMDAโ Use a local context to collect metrics from DSO PMDAs on the local host without PMCD. See also-K. do it yourself energy. ๐ช-m,--include-labelsโ Include PCP metric labels in the output. ๐ท๏ธ-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. flip the script. ๐-Npredicate,--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 (seePCPIntro(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. ๐ฏ
-Oorigin,--origin=origin โ when we're reporting archived metrics, this is where you say "bestie, start reporting at origin inside the time window" (the time window being the-S/-Tsituation). The syntax for origin lives inPCPIntro(1), go check it there. ๐ฐ๏ธ-ptype,--es-search-type=type โ the Elasticsearch search type for measurements. That's it, that's the whole vibe. ๐-Pprecision,--precision=precision โ use precision for your numeric non-integer output values. Default behaviour is 3 decimal places (when applicable, okay, when it even matters). Heads up: this will not override any possible per-metric specifications, so if a metric has its own opinion, that opinion wins. ๐-qscale,--count-scale=scale โ unit/scale for count metrics. Possible values includecount x 10^-1,count,count x 10,count x 10^2, and so on and so forth all the way from10^-8to10^7. > Careful: these values are currently space-sensitive. So don't get cute with the spacing. Also, this will not override possible per-metric specifications. See alsopmParseUnitsStr(3). ๐ข-Qscale,--count-scale-force=scale โ literally-qbut it's the assertive version: this one will override per-metric specifications. Main character energy, no apologies. ๐-r,--rawโ output raw metric values, meaning do not convert cumulative counters to rates. This option will override possible per-metric specifications. Raw is raw. ๐ง-R,--raw-preferโ like-rexcept it's polite about it: it will not override per-metric specifications. ๐ซถ-ssamples,--samples=samples โ samples is how many samples you want retrieved and reported. If samples is0, or if you just never passed-sat all,pcp2elasticsearchwill sample and report continuously (that's real time mode) or until the end of the set of PCP archives (that's archive mode). See also-T. โพ๏ธ-Sstarttime,--start=starttime โ when reporting archived metrics, your report gets restricted to only those records logged at or after starttime. Full syntax for starttime is over inPCPIntro(1). โฉ-tinterval,--interval=interval โ set the reporting interval to something other than the default of 1 second. The interval argument follows the syntax described inPCPIntro(1), and in the simplest form it can just be an unsigned integer (in which case the implied units are seconds). See also the-Toption. โฑ๏ธ-Tendtime,--finish=endtime โ when reporting archived metrics, your report gets restricted to only those records logged before or at endtime. Full syntax for endtime lives inPCPIntro(1).
And when you use this to define the runtime before pcp2elasticsearch will exit: if no samples is given (peep -s) then the number of reported samples depends on interval (peep -t). If samples is given, then interval will get adjusted so it can report that many samples during the runtime. And in case all of -T, -s, and -t are given, endtime determines the actual time pcp2elasticsearch will run. So -T is holding the aux cord at that point. โน๏ธ
-v,--omit-flatโ report only set-valued metrics with instances (thinkdisk.dev.read) and omit the single-valued "flat" metrics that have no instances (thinkkernel.all.sysfork). See-iand-I. ๐ซ-V,--versionโ display version number and exit. Simple, iconic. โจ-xindex,--es-index=index โ Elasticsearch index for metric names. ๐๏ธ-Xhostid,--es-hostid=hostid โ Elasticsearch hostid for measurements. ๐ท๏ธ-yscale,--time-scale=scale โ unit/scale for time metrics. Possible values includenanosec,ns,microsec,us,millisec,ms, and so forth up tohour,hr. This option will not override possible per-metric specifications. See alsopmParseUnitsStr(3). ๐-Yscale,--time-scale-force=scale โ like-ybut this one will override per-metric specifications. Yeah, she said what she said. ๐-?,--helpโ display usage message and exit. When in doubt, ask for help, bestie. ๐
๐ค OUTPUT FORMAT ๐ค
Okay so first thing's first: pcp2elasticsearch sends this type definition over to Elasticsearch:
{
"mappings": {
"properties": {
"@timestamp": {
"type": "long"
},
"host-id": {
"type": "text"
}
}
}
}
And the actual metrics data document? It's giving something like this:
{
"@host-id": "bozo",
"@timestamp": 1507637520,
"mem": {
"util": {
"used": 4525820,
"free": 3344000
}
},
"disk": {
"partitions": {
"@instances": [
{
"read": 1121,
"@id": "sda1"
},
{
"read": 77306,
"@id": "sda2"
},
{
"read": 131,
"@id": "sda3"
}
]
}
}
}
๐ FILES ๐
pcp2elasticsearch.confโ thepcp2elasticsearchconfiguration file (see-c). ๐$PCP_SYSCONF_DIR/pmrep/*.confโ the system provided defaultpmrepconfiguration 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 may be used to specify an alternative configuration file, as described in pcp.conf(5). ๐งญ
For environment variables affecting PCP tools, check 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 ngl, 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), pcp2graphite(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's from Performance Co-Pilot โ the PCP collection, dated PCP2ELASTICSEARCH(1). Go ship some metrics to Elasticsearch and slay. ๐ฆโจ periodt. ๐
๐ฆ 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-export-pcp2elasticsearch 7.2.1-2build1
- Copyright (C) 2015-2021 Marko Myllynen <myllynen@redhat.com>
- Copyright (C) 2016-2018,2022 Red Hat
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms