Skip to content

Commit 3a93258

Browse files
committed
in_podman_metrics: add exclude_name_regex option
Add an optional 'exclude_name_regex' configuration option to skip containers whose name matches a user-supplied regular expression before their metrics are collected and emitted. This mirrors the regex filtering model already used by the node exporter (netdev.ignore_device_regex) and the diskstats/filesystem collectors. A typical use is dropping Podman pod infrastructure containers, e.g. exclude_name_regex '-(infra|service)$' to skip pause and catatonit containers that carry no useful application metrics. The option defaults to unset, so existing behaviour (collect every container) is unchanged. Signed-off-by: Stefano Tondo <stondo@gmail.com>
0 parents  commit 3a93258

11,715 files changed

Lines changed: 4050924 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.build-trigger

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b265b55a-cfa6-4f9b-a035-4421ee68b7f9

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "devcontainer-fluent-bit",
3+
"image": "fluent/fluent-bit:latest-debug",
4+
5+
// Features to add to the dev container. More info: https://containers.dev/features.
6+
"features": {
7+
// add non-root user. it is similar your local user.
8+
"ghcr.io/devcontainers/features/common-utils:2": {
9+
"version": "latest",
10+
"username": "fluent-bit"
11+
},
12+
13+
// docker-in-docker allows you to run Docker commands inside the dev container. Thus, it supports to build docker build in the environment.
14+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
15+
"version": "latest",
16+
"moby": false,
17+
"dockerDashComposeVersion": "v1"
18+
}
19+
},
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// The ports are useful while sending data over tcp/udp from local applications.
23+
"forwardPorts": [
24+
// 2020 // fluent metrics etc.
25+
// 80 // http input etc.
26+
],
27+
28+
"customizations": {
29+
"vscode": {
30+
"extensions": [
31+
"ms-vscode.cpptools",
32+
"ms-azuretools.vscode-docker"
33+
]
34+
}
35+
},
36+
37+
"remoteUser": "fluent-bit"
38+
}

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# We need the git commit info
2+
# .git
3+
build/**
4+
dockerfiles/**

.github/ISSUE_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!---
2+
Thanks for filing an issue 😄 ! Before you submit, please read the following:
3+
4+
Please post all questions and issues on https://slack.fluentd.org/ on the fluent-bit before opening a Github Issue. Your questions will reach a wider audience there,
5+
and if we confirm that there is a bug, then you can open a new issue.
6+
7+
Check the other issue templates if you are trying to submit a bug report, feature request, or question
8+
Search open/closed issues before submitting since someone might have asked the same thing before!
9+
-->
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: "\U0001F41B Bug Report"
3+
about: "If something isn't working as expected \U0001F914."
4+
title: ''
5+
labels: 'status: waiting-for-triage'
6+
assignees: ''
7+
8+
---
9+
10+
## Bug Report
11+
12+
**Describe the bug**
13+
<!--- A clear and concise description of what the bug is. -->
14+
15+
**To Reproduce**
16+
- Rubular link if applicable:
17+
- Example log message if applicable:
18+
```
19+
{"log":"YOUR LOG MESSAGE HERE","stream":"stdout","time":"2018-06-11T14:37:30.681701731Z"}
20+
```
21+
- Steps to reproduce the problem:
22+
23+
**Expected behavior**
24+
<!--- A clear and concise description of what you expected to happen. -->
25+
26+
**Screenshots**
27+
<!--- If applicable, add screenshots to help explain your problem. -->
28+
29+
**Your Environment**
30+
<!--- Include as many relevant details about the environment you experienced the bug in -->
31+
* Version used:
32+
* Configuration:
33+
* Environment name and version (e.g. Kubernetes? What version?):
34+
* Server type and version:
35+
* Operating System and version:
36+
* Filters and plugins:
37+
38+
**Additional context**
39+
<!--- How has this issue affected you? What are you trying to accomplish? -->
40+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
12+
13+
**Describe the solution you'd like**
14+
<!--- A clear and concise description of what you want to happen. -->
15+
16+
**Describe alternatives you've considered**
17+
<!--- A clear and concise description of any alternative solutions or features you've considered. -->
18+
19+
**Additional context**
20+
<!--- How has this issue affected you? What are you trying to accomplish? -->
21+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
22+
<!--- Add any other context or screenshots about the feature request here. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- Provide summary of changes -->
2+
3+
<!-- Issue number, if available. E.g. "Fixes #31", "Addresses #42, #77" -->
4+
5+
----
6+
Enter `[N/A]` in the box, if an item is not applicable to your change.
7+
8+
**Testing**
9+
Before we can approve your change; please submit the following in a comment:
10+
11+
- [ ] Example configuration file for the change
12+
- [ ] Debug log output from testing the change
13+
<!--
14+
Please refer to the Developer Guide for instructions on building Fluent Bit with Valgrind support:
15+
https://github.com/fluent/fluent-bit/blob/master/DEVELOPER_GUIDE.md#valgrind
16+
Invoke Fluent Bit and Valgrind as: $ valgrind --leak-check=full ./bin/fluent-bit <args>
17+
-->
18+
- [ ] Attached [Valgrind](https://valgrind.org/docs/manual/quick-start.html) output that shows no leaks or memory corruption was found
19+
20+
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
21+
22+
- [ ] Run [local packaging test](./packaging/local-build-all.sh) showing all targets (including any new ones) build.
23+
- [ ] Set `ok-package-test` label to test for all targets (requires maintainer to do).
24+
25+
**Documentation**
26+
<!-- Docs can be edited at https://github.com/fluent/fluent-bit-docs -->
27+
- [ ] Documentation required for this feature
28+
29+
<!-- Doc PR (not required but highly recommended) -->
30+
31+
**Backporting**
32+
<!--
33+
PRs targeting the default master branch will go into the next major release usually.
34+
If this PR should be backported to the current or earlier releases then please submit a PR for that particular branch.
35+
-->
36+
- [ ] Backport to latest stable release.
37+
38+
<!-- Other release PR (not required but highly recommended for quick turnaround) -->
39+
----
40+
41+
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

.github/actionlint-matcher.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "actionlint",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 4,
12+
"code": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/actionlint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
self-hosted-runner:
2+
labels:
3+
- actuated-arm64-8cpu-16gb
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Composite action to generate the matrix of targets to build packages for.
2+
description: Remove any duplication of this information so we only have to update in one place.
3+
4+
# Remember to add any new checks and target creation required.
5+
# For example, when 2.0 comes out we should detect it and add any target changes.
6+
7+
inputs:
8+
target:
9+
description: Override to build a single target for debug/test only.
10+
required: false
11+
default: ""
12+
ref:
13+
description: The commit, tag or branch of Fluent Bit to checkout for building we then use to determine version for.
14+
required: true
15+
outputs:
16+
build-matrix:
17+
description: The total build matrix we have created.
18+
value: ${{ steps.set-matrix.outputs.matrix }}
19+
deb-build-matrix:
20+
description: The targets that provide DEB artefacts.
21+
value: ${{ steps.set-matrix.outputs.debmatrix }}
22+
rpm-build-matrix:
23+
description: The targets that provide RPN artefacts.
24+
value: ${{ steps.set-matrix.outputs.rpmmatrix }}
25+
runs:
26+
using: "composite"
27+
steps:
28+
- name: Checkout code for version check
29+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
30+
with:
31+
ref: ${{ inputs.ref }}
32+
path: version-check
33+
persist-credentials: false
34+
35+
- name: Determine target type
36+
id: determine-build-type
37+
run: |
38+
BUILD_TYPE="legacy"
39+
if [[ -f "packaging/build-config.json" ]]; then
40+
BUILD_TYPE="modern"
41+
fi
42+
echo "Detected type: $BUILD_TYPE"
43+
echo "BUILD_TYPE=$BUILD_TYPE" >> $GITHUB_OUTPUT
44+
shell: bash
45+
working-directory: version-check
46+
47+
- name: 2.0+ targets
48+
if: steps.determine-build-type.outputs.BUILD_TYPE == 'modern'
49+
run: |
50+
matrix=$(echo '{ "distro" : '$(jq -cr '.linux_targets|map(.target)' packaging/build-config.json)'}'|jq -c .)
51+
echo "MATRIX=$matrix" >> $GITHUB_ENV
52+
53+
# The following are only used by release so exclude architecture as well
54+
55+
debtargets=$(jq -cr '[.linux_targets[] | select(.target|contains("arm64v8")|not) | select(.type=="deb") | .target ]' packaging/build-config.json)
56+
debmatrix=$(echo "{ \"distro\" : $debtargets }"|jq -c .)
57+
echo "DEB_MATRIX=$debmatrix" >> $GITHUB_ENV
58+
59+
rpmtargets=$(jq -cr '[.linux_targets[] | select(.target|contains("arm64v8")|not) | select(.type=="rpm") | .target ]' packaging/build-config.json)
60+
rpmmatrix=$(echo "{ \"distro\" : $rpmtargets}"|jq -c .)
61+
echo "RPM_MATRIX=$rpmmatrix" >> $GITHUB_ENV
62+
shell: bash
63+
64+
- name: 1.9 targets
65+
if: steps.determine-build-type.outputs.BUILD_TYPE == 'legacy'
66+
run: |
67+
matrix=$((
68+
echo '{ "distro" : ['
69+
echo '"amazonlinux/2", "amazonlinux/2.arm64v8",'
70+
echo '"centos/7", "centos/7.arm64v8", "centos/8", "centos/8.arm64v8",'
71+
echo '"debian/buster", "debian/buster.arm64v8", "debian/bullseye", "debian/bullseye.arm64v8",'
72+
echo '"ubuntu/16.04", "ubuntu/18.04", "ubuntu/20.04", "ubuntu/22.04",'
73+
echo '"ubuntu/18.04.arm64v8", "ubuntu/20.04.arm64v8", "ubuntu/22.04.arm64v8",'
74+
echo '"raspbian/buster", "raspbian/bullseye"'
75+
echo ']}'
76+
) | jq -c .)
77+
echo "MATRIX=$matrix" >> $GITHUB_ENV
78+
debmatrix=$((
79+
echo '{ "distro" : ['
80+
echo '"debian/buster", "debian/bullseye",'
81+
echo '"ubuntu/16.04", "ubuntu/18.04", "ubuntu/20.04", "ubuntu/22.04",'
82+
echo '"raspbian/buster", "raspbian/bullseye"'
83+
echo ']}'
84+
) | jq -c .)
85+
echo "DEB_MATRIX=$debmatrix" >> $GITHUB_ENV
86+
rpmmatrix=$((
87+
echo '{ "distro" : ['
88+
echo '"amazonlinux/2",'
89+
echo '"centos/7", "centos/8"'
90+
echo ']}'
91+
) | jq -c .)
92+
echo "RPM_MATRIX=$rpmmatrix" >> $GITHUB_ENV
93+
shell: bash
94+
95+
- name: Manual override of target
96+
if: inputs.target != ''
97+
run: |
98+
if [ -n "${{ inputs.target || '' }}" ]; then
99+
echo "Overriding matrix to build: ${{ inputs.target }}"
100+
matrix=$((
101+
echo '{ "distro" : ['
102+
echo '"${{ inputs.target }}"'
103+
echo ']}'
104+
) | jq -c .)
105+
fi
106+
echo "MATRIX=$matrix" >> $GITHUB_ENV
107+
shell: bash
108+
109+
- id: set-matrix
110+
run: |
111+
echo $MATRIX
112+
echo $MATRIX| jq .
113+
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
114+
echo $DEB_MATRIX
115+
echo $DEB_MATRIX| jq .
116+
echo "debmatrix=$DEB_MATRIX" >> $GITHUB_OUTPUT
117+
echo $RPM_MATRIX
118+
echo $RPM_MATRIX| jq .
119+
echo "rpmmatrix=$RPM_MATRIX" >> $GITHUB_OUTPUT
120+
shell: bash

0 commit comments

Comments
 (0)