- config.default.yml - This file contains all configuration options and descriptions.
- config.minimal.yml - This file contains a minimum configuration and no descriptions.
Before you start
- Optionally, copy one of the sample files in the
configdirectory and rename it toconfig.yml. - The
config.minimal.ymlfile doesn’t include a metrics section. Copy this section from the example below if the extractor is required to send metrics to a Prometheus Pushgateway. - Set up an extraction pipeline and note the external ID.
Minimal YAML configuration file
The YAML settings below contain valid PI extractor 2.1 configurations. The values wrapped in${} are replaced with environment variables with that name. For example, ${COGNITE_PROJECT} will be replaced with the value of the environment variable called COGNITE_PROJECT.
The configuration file has a global parameter version, which holds the version of the configuration schema used in the configuration file. This document describes version 3 of the configuration schema.
-
versionis the version of the configuration schema. Use version 3 to be compatible with the Cognite PI extractor 2.1. -
cogniteis the how the extractor reads the authentication details for PI (pi) and CDF (cognite) from environment variables. Since no host is specified in thecognitesection, the extractor uses the default value, <https://api.cognitedata.com >, and assumes that the PI server uses Windows authentication. -
time-seriesconfigures the extractor to create time series in CDF where the external IDs will be prefixed withpi:. You can also use a data set ID configuration to add all time series created by the extractor to a particular data set. -
state-storeconfigures the extractor to save the extraction state locally using a LiteDB database file namedstate.db. -
loggerconfigures the extractor to log at information level and outputs log messages to a log file in the logs/log.log directory. By default, new files are created daily and retained for 31 days. The date is appended to the file name.
Writing to CDF Data Models
The extractor can write directly to a core data model time series, or more correctly, to an extended version of theCogniteTimeSeries Data Model type. To save/update instances of CogniteTimeSeries, specify the identifier for the target Data Modeling Space in the configuration, using the space-id parameter of the time series configuration section.
The behavior in this mode is almost identical to classic time series destination, except for a few key differences:
-
Metadata is written as a json blob to the extended time series type (
CogniteExtractorTimeSeries), and saved in theextractedDataproperty. -
data-set-idconfiguration option is ignored.
Using values from Azure Key Vault
The PI extractor also supports loading values from Azure Key Vault. To load a configuration value from Azure Key Vault, use the!keyvault tag followed by the name of the secret you want to load. For example, to load the value of the my-secret-name secret in Key Vault into a password parameter, configure your extractor like this:
key-vault section in your configuration, with the following parameters:
Example:
Timestamps and intervals
In most places where time intervals are required, you can use a CDF-like syntax of[N][timeunit], for example 10m for 10 minutes or 1h for 1 hour. timeunit is one of d, h, m, s, ms. You can also use a cron expression in some places.
For configuring the earliest point to backfill to you can use a similar syntax. [N][timeunit] and [N][timeunit]-ago. 1d-ago means 1 day in the past from the time history starts, and 1h means 1 hour in the future. For instance, you can use this syntax to configure the backfill only recent history.
You can also set the backfill target to a specific date on RFC 3339 form, like 2025-07-02T22:23:12Z, or on a shorter form like 2022-11-20+12:00. A timezone specifier is necessary, Z means UTC.
Configure the PI extractor
Configuration for the PI extractor. Each section configures a different aspect of the extractor. logger
Global parameter.
Configuration for logging to console or file. Log entries are either Fatal, Error, Warning, Information, Debug, or Verbose, in order of decreasing priority. The extractor will log any messages at an equal or higher log level than the configured level for each sink.
console
Part of logger configuration.
Configuration for logging to the console.
file
Part of logger configuration.
Configuration for logging to a rotating log file.
trace-listener
Part of logger configuration.
Adds a listener that uses the configured logger to output messages from System.Diagnostics.Trace
metrics
Global parameter.
Configuration for publishing metrics.
server
Part of metrics configuration.
Configuration for having the extractor start a Prometheus scrape server on a local port.
push-gateways
Part of metrics configuration.
A list of pushgateway destinations to push metrics to. The extractor will automatically push metrics to each of these.
cognite
Global parameter.
Configure connection to CDF
idp-authentication
Part of cognite configuration.
The idp-authentication section enables the extractor to authenticate to CDF using an external identity provider (IdP), such as Microsoft Entra ID (formerly Azure Active Directory).
See OAuth 2.0 client credentials flow
certificate
Part of idp-authentication configuration.
Authenticate with a client certificate
cdf-retries
Part of cognite configuration.
Configure automatic retries on requests to CDF.
cdf-chunking
Part of cognite configuration.
Configure chunking of data on requests to CDF. Note that increasing these may cause requests to fail due to limits in the API itself
cdf-throttling
Part of cognite configuration.
Configure the maximum number of parallel requests for different CDF resources.
sdk-logging
Part of cognite configuration.
Configure logging of requests from the SDK
extraction-pipeline
Part of cognite configuration.
Configure an associated extraction pipeline
certificates
Part of cognite configuration.
Configure special handling of SSL certificates. This should never be considered a permanent solution to certificate problems
allow-list
Part of certificates configuration.
List of certificate thumbprints to automatically accept. This is a much smaller risk than accepting all certificates
Each element of this list should be a string.
metadata-targets
Part of cognite configuration.
Configuration for targets for time series metadata.
raw
Part of metadata-targets configuration.
Configuration for writing metadata to CDF Raw.
clean
Part of metadata-targets configuration.
Configuration for enabling writing metadata to CDF Clean.
state-store
Global parameter.
Include the state-store section to configure the extractor to save the extraction state periodically. This makes the extraction resume faster in the next run. This section is optional. If not present, or if database is set to none, the extraction state is restored by querying the timestamps of the first and last data points of each time series. If CDF Raw is used as a state store, you can see the extracted ranges under Manage staged data in CDF.
pi
Global parameter.
Configure the extractor to connect to a particular PI server or PI collective. If you configure the extractor with a PI collective, the extractor will transparently maintain a connection to one of the active servers in the collective. The default settings provide Active Directory authorization to the PI host when the server account for the Windows service is authorized.
time-series
Global parameter.
Include the time-series section for configuration related to the time series ingested by the extractor. This section is optional.
The example would create time series on the following form in CDF:
events
Global parameter.
Configuration for writing events on reconnect and data loss incidents
The example configuration produces events on the following form
extractor
Global parameter.
The extractor section contains various configuration options for the operation of the extractor itself. The options here can be used to extract only a subset of the PI points in the server. This is how the list is created:
- If
include-tags,include-prefixes,include-patternsorinclude-attribute-valuesare not empty, start with the union of these three. Otherwise, start with all points. - Remove points as specified by
exclude-tags,exclude-prefixes,exclude-patternsandexclude-attribute-values.
include-tags
Part of extractor configuration.
Include tags with name exactly equal to one of these names.
Each element of this list should be a string.
include-prefixes
Part of extractor configuration.
Include tags with name starting with one of these prefixes.
Each element of this list should be a string.
include-patterns
Part of extractor configuration.
Include tags with name containing one of these substrings.
Each element of this list should be a string.
include-attribute-values
Part of extractor configuration.
Include tags with attributes equal to at least one of these key/value pairs.
exclude-tags
Part of extractor configuration.
Exclude tags with name exactly equal to one of these names.
Each element of this list should be a string.
exclude-prefixes
Part of extractor configuration.
Exclude tags with name starting with one of these prefixes.
Each element of this list should be a string.
exclude-patterns
Part of extractor configuration.
Exclude tags with name containing one of these substrings.
Each element of this list should be a string.
exclude-attribute-values
Part of extractor configuration.
Exclude tags with attributes equal to at least one of these key/value pairs.
deleted-time-series
Part of extractor configuration.
Include the deleted-time-series subsection to configure how the extractor handles time series that exist in CDF but not in PI. This subsection is optional, and the default behavior is none (do nothing).
This only affects time series with the same data set ID and external ID prefix as the time series configured in the extractor.
- Lists all time series in CDF that have the configured external ID prefix and data set ID.
- Filters the time series using the include/exclude rules defined in the extractor section.
- Matches the result against the time series obtained from the PI Server after filtering these using the include/exclude rules.
status-codes
Part of extractor configuration.
Configuration for ingesting status codes to CDF timeseries.
backfill
Global parameter.
Include the backfill section to configure how the extractor fills in historical data back in time with respect to the first data point in CDF. The backfill process completes when all the data points in the PI Data Archive are sent to CDF or when the extractor reaches the target timestamp for all time series if the to parameter is set.
frontfill
Global parameter.
Include the frontfill section to configure how the extractor fills in historical data forward in time with respect to the last data point in CDF. At startup, the extractor fills in the gap between the last data point in CDF and the last data point in PI by querying the archived data in the PI Data Archive. After that, the extractor only receives data streamed through the PI Data Pipe. These are real-time changes made to the time series in PI before archiving.
When data points are archived in PI, they may be subject to compression, reducing the total amount of data points in a time series. Therefore, the backfill and frontfill tasks will receive data points after compression, while the streaming task will receive data points before compression. Learn more about compression in this video.
high-availability
Global parameter.
Configuration for a Redis based high availability store. Requires Redis to be configured in state-store.