Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
459e509f
Unverified
Commit
459e509f
authored
Feb 05, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #73549 from haiyanmeng/runtimeclass
Add monitoring for RuntimeClass
parents
a20cd49d
18bcdcec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
instrumented_services.go
pkg/kubelet/kuberuntime/instrumented_services.go
+6
-1
metrics.go
pkg/kubelet/metrics/metrics.go
+20
-0
No files found.
pkg/kubelet/kuberuntime/instrumented_services.go
View file @
459e509f
...
@@ -178,10 +178,15 @@ func (in instrumentedRuntimeService) Attach(req *runtimeapi.AttachRequest) (*run
...
@@ -178,10 +178,15 @@ func (in instrumentedRuntimeService) Attach(req *runtimeapi.AttachRequest) (*run
func
(
in
instrumentedRuntimeService
)
RunPodSandbox
(
config
*
runtimeapi
.
PodSandboxConfig
,
runtimeHandler
string
)
(
string
,
error
)
{
func
(
in
instrumentedRuntimeService
)
RunPodSandbox
(
config
*
runtimeapi
.
PodSandboxConfig
,
runtimeHandler
string
)
(
string
,
error
)
{
const
operation
=
"run_podsandbox"
const
operation
=
"run_podsandbox"
defer
recordOperation
(
operation
,
time
.
Now
())
startTime
:=
time
.
Now
()
defer
recordOperation
(
operation
,
startTime
)
defer
metrics
.
RunPodSandboxLatencies
.
WithLabelValues
(
runtimeHandler
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
startTime
))
out
,
err
:=
in
.
service
.
RunPodSandbox
(
config
,
runtimeHandler
)
out
,
err
:=
in
.
service
.
RunPodSandbox
(
config
,
runtimeHandler
)
recordError
(
operation
,
err
)
recordError
(
operation
,
err
)
if
err
!=
nil
{
metrics
.
RunPodSandboxErrors
.
WithLabelValues
(
runtimeHandler
)
.
Inc
()
}
return
out
,
err
return
out
,
err
}
}
...
...
pkg/kubelet/metrics/metrics.go
View file @
459e509f
...
@@ -65,6 +65,10 @@ const (
...
@@ -65,6 +65,10 @@ const (
ConfigUIDLabelKey
=
"node_config_uid"
ConfigUIDLabelKey
=
"node_config_uid"
ConfigResourceVersionLabelKey
=
"node_config_resource_version"
ConfigResourceVersionLabelKey
=
"node_config_resource_version"
KubeletConfigKeyLabelKey
=
"node_config_kubelet_key"
KubeletConfigKeyLabelKey
=
"node_config_kubelet_key"
// Metrics keys for RuntimeClass
RunPodSandboxLatenciesKey
=
"run_podsandbox_latencies"
RunPodSandboxErrorsKey
=
"run_podsandbox_errors"
)
)
var
(
var
(
...
@@ -210,6 +214,22 @@ var (
...
@@ -210,6 +214,22 @@ var (
Help
:
"This metric is true (1) if the node is experiencing a configuration-related error, false (0) otherwise."
,
Help
:
"This metric is true (1) if the node is experiencing a configuration-related error, false (0) otherwise."
,
},
},
)
)
RunPodSandboxLatencies
=
prometheus
.
NewSummaryVec
(
prometheus
.
SummaryOpts
{
Subsystem
:
KubeletSubsystem
,
Name
:
RunPodSandboxLatenciesKey
,
Help
:
"Latencies in microseconds of the run_podsandbox operations. Broken down by RuntimeClass."
,
},
[]
string
{
"runtime_handler"
},
)
RunPodSandboxErrors
=
prometheus
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Subsystem
:
KubeletSubsystem
,
Name
:
RunPodSandboxErrorsKey
,
Help
:
"Cumulative number of the run_podsandbox operation errors by RuntimeClass."
,
},
[]
string
{
"runtime_handler"
},
)
)
)
var
registerMetrics
sync
.
Once
var
registerMetrics
sync
.
Once
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment