Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
custom-metrics-generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cloud
custom-metrics-generator
Commits
c7f6f030
Commit
c7f6f030
authored
4 years ago
by
František Řezníček
Browse files
Options
Downloads
Patches
Plain Diff
fix: cAdvisor metrics compliance - name and id label values
parent
780a6bee
No related branches found
No related tags found
Loading
Pipeline
#94410
passed
4 years ago
Stage: build-image
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+6
-0
6 additions, 0 deletions
CHANGELOG.md
src/metric-generators/dockermon.sh
+2
-2
2 additions, 2 deletions
src/metric-generators/dockermon.sh
with
8 additions
and
2 deletions
CHANGELOG.md
+
6
−
0
View file @
c7f6f030
...
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [Unreleased]
## [1.0.3] - 2021-07-12
### Fixed
-
compliance with cAdvisor:
*
container name (
`name`
) never starts with
`/`
, dropping leading slash too
*
container id (
`id`
) is prefixed with
`/docker/`
## [1.0.2] - 2021-06-30
## [1.0.2] - 2021-06-30
### Fixed
### Fixed
-
dockermon textfile metrics documentation string now correctly prefixed with
`# `
-
dockermon textfile metrics documentation string now correctly prefixed with
`# `
...
...
This diff is collapsed.
Click to expand it.
src/metric-generators/dockermon.sh
+
2
−
2
View file @
c7f6f030
...
@@ -15,9 +15,9 @@ CONTAINERS=$(docker ps -a -q)
...
@@ -15,9 +15,9 @@ CONTAINERS=$(docker ps -a -q)
for
i_container
in
${
CONTAINERS
}
;
do
for
i_container
in
${
CONTAINERS
}
;
do
i_container_status
=
"
$(
docker inspect
"
${
i_container
}
"
)
"
i_container_status
=
"
$(
docker inspect
"
${
i_container
}
"
)
"
i_container_name
=
"
$(
echo
"
${
i_container_status
}
"
| jq
-r
'.[].Name'
)
"
i_container_name
=
"
$(
echo
"
${
i_container_status
}
"
| jq
-r
'.[].Name'
|
sed
's|^/||'
)
"
i_container_restart_count
=
"
$(
echo
"
${
i_container_status
}
"
| jq
-r
'.[].RestartCount'
)
"
i_container_restart_count
=
"
$(
echo
"
${
i_container_status
}
"
| jq
-r
'.[].RestartCount'
)
"
i_container_id
=
"
$(
echo
"
${
i_container_status
}
"
| jq
-r
'.[].Id'
)
"
i_container_id
=
"
/docker/
$(
echo
"
${
i_container_status
}
"
| jq
-r
'.[].Id'
)
"
test
-n
"
${
i_container_name
}
"
test
-n
"
${
i_container_name
}
"
echo
-n
"
${
i_container_restart_count
}
"
|
grep
-Eq
"^[0-9]+$"
echo
-n
"
${
i_container_restart_count
}
"
|
grep
-Eq
"^[0-9]+$"
echo
-n
"
${
i_container_id
}
"
|
grep
-Eq
"^[a-fA-F0-9]{12,}$"
echo
-n
"
${
i_container_id
}
"
|
grep
-Eq
"^[a-fA-F0-9]{12,}$"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment