-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
118 additions
and
108 deletions.
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
...ernetes-pixie/kubernetes-integration/advanced-configuration/data-governance.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
--- | ||
title: Data governance | ||
tags: | ||
- Integrations | ||
- Kubernetes integration | ||
- Configuration | ||
metaDescription: How to manage your data of the Kubernetes integration. | ||
--- | ||
|
||
### Change the scrape interval [#scrape-interval] | ||
|
||
The Kubernetes Integration v3 and above allows changing the interval at which metrics are gathered from the cluster. This allows choosing a tradeoff between data resolution and usage. We recommend choosing an interval between 15 and 30 seconds for optimal experience. | ||
|
||
In order to change the scrape interval, add the following to your `values-newrelic.yaml`, under the `newrelic-infratructure` section: | ||
|
||
```yaml | ||
common: | ||
config: | ||
interval: 25s | ||
``` | ||
|
||
So it ends up looking like: | ||
|
||
```yaml | ||
global: | ||
licenseKey: _YOUR_NEW_RELIC_LICENSE_KEY_ | ||
cluster: _K8S_CLUSTER_NAME_ | ||
|
||
# ... Other settings as shown above | ||
|
||
# Configuration for newrelic-infrastructure | ||
newrelic-infrastructure: | ||
# ... Other settings as shown above | ||
common: | ||
config: | ||
interval: 25s | ||
``` | ||
|
||
<Callout variant="important"> | ||
Setting `interval` to values larger than `40s` is not allowed. | ||
</Callout> | ||
|
||
### Filtering Namespaces [#filter-namespace] | ||
|
||
The Kubernetes Integration v3 and above allows filtering which namespaces are scraped by labelling them. By default all namespaces are scraped. | ||
|
||
We use the `namespaceSelector` in the same way kubernetes does. In order to include only namespaces matching a label, change the `namespaceSelector` by adding the following to your `values-newrelic.yaml`, under the `newrelic-infratructure` section: | ||
|
||
```yaml | ||
common: | ||
config: | ||
namespaceSelector: | ||
matchLabels: | ||
key1 : "value1" | ||
``` | ||
|
||
In this example only namespaces with the label `newrelic.com/scrape` set to `true` will be scraped: | ||
|
||
```yaml | ||
global: | ||
licenseKey: _YOUR_NEW_RELIC_LICENSE_KEY_ | ||
cluster: _K8S_CLUSTER_NAME_ | ||
|
||
# ... Other settings as shown above | ||
|
||
# Configuration for newrelic-infrastructure | ||
newrelic-infrastructure: | ||
# ... Other settings as shown above | ||
common: | ||
config: | ||
namespaceSelector: | ||
matchLabels: | ||
newrelic.com/scrape: "true" | ||
``` | ||
|
||
You can also use kubernetes expressions to include or exclude namespaces using the following syntax: | ||
|
||
```yaml | ||
common: | ||
config: | ||
namespaceSelector: | ||
matchExpressions: | ||
- {key: newrelic.com/scrape, operator: NotIn, values: ["false"]} | ||
- {key: key1, operator: In, values: ["value1"]} | ||
``` | ||
|
||
<Callout variant="tip"> | ||
The expressions under `matchExpressions` are concatenated. | ||
</Callout> | ||
|
||
In this example namespaces with the label `newrelic.com/scrape` set to `false` will be excluded: | ||
|
||
```yaml | ||
global: | ||
licenseKey: _YOUR_NEW_RELIC_LICENSE_KEY_ | ||
cluster: _K8S_CLUSTER_NAME_ | ||
|
||
# ... Other settings as shown above | ||
|
||
# Configuration for newrelic-infrastructure | ||
newrelic-infrastructure: | ||
# ... Other settings as shown above | ||
common: | ||
config: | ||
namespaceSelector: | ||
matchExpressions: | ||
- {key: newrelic.com/scrape, operator: NotIn, values: ["false"]} | ||
``` | ||
|
||
See a full list of the settings that can be modified in the [chart's README file](https://github.com/newrelic/nri-kubernetes/tree/main/charts/newrelic-infrastructure). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters