Documentation ¶
Index ¶
- Variables
- type Bookmark
- type Container
- type ContainerPort
- type DaemonEndpoint
- type Endpoint
- type EndpointAddress
- type EndpointConditions
- type EndpointPort
- type EndpointSlice
- type EndpointSliceList
- type EndpointSubset
- type Endpoints
- type EndpointsList
- type Error
- type HTTPIngressPath
- type HTTPIngressRuleValue
- type Ingress
- type IngressList
- type IngressRule
- type IngressSpec
- type IngressTLS
- type ListMeta
- type Namespaces
- type Node
- type NodeAddress
- type NodeDaemonEndpoints
- type NodeList
- type NodeStatus
- type ObjectMeta
- type ObjectReference
- type OwnerReference
- type Pod
- type PodCondition
- type PodList
- type PodSpec
- type PodStatus
- type SDConfig
- type ScrapeWorkConstructorFunc
- type Selector
- type Service
- type ServiceList
- type ServicePort
- type ServiceSpec
- type WatchEvent
Constants ¶
This section is empty.
Variables ¶
var SDCheckInterval = flag.Duration("promscrape.kubernetesSDCheckInterval", 30*time.Second, "Interval for checking for changes in Kubernetes API server. "+
"This works only if kubernetes_sd_configs is configured in '-promscrape.config' file. "+
"See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config for details")
SDCheckInterval defines interval for targets refresh.
Functions ¶
This section is empty.
Types ¶
type Bookmark ¶ added in v1.56.0
type Bookmark struct { Metadata struct { ResourceVersion string } }
Bookmark is a bookmark message from Kubernetes Watch API. See https://kubernetes.io/docs/reference/using-api/api-concepts/#watch-bookmarks
type Container ¶
type Container struct { Name string Ports []ContainerPort }
Container implements k8s container.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#container-v1-core
type ContainerPort ¶
ContainerPort implements k8s container port.
type DaemonEndpoint ¶
type DaemonEndpoint struct {
Port int
}
DaemonEndpoint represents DaemonEndpoint from k8s API.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#daemonendpoint-v1-core
type Endpoint ¶ added in v1.41.0
type Endpoint struct { Addresses []string Conditions EndpointConditions Hostname string TargetRef ObjectReference Topology map[string]string }
Endpoint implements kubernetes object endpoint for endpoint slice.
type EndpointAddress ¶
type EndpointAddress struct { Hostname string IP string NodeName string TargetRef ObjectReference }
EndpointAddress implements k8s endpoint address.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#endpointaddress-v1-core
type EndpointConditions ¶ added in v1.41.0
type EndpointConditions struct {
Ready bool
}
EndpointConditions implements kubernetes endpoint condition.
type EndpointPort ¶
EndpointPort implements k8s endpoint port.
type EndpointSlice ¶ added in v1.41.0
type EndpointSlice struct { Metadata ObjectMeta Endpoints []Endpoint AddressType string Ports []EndpointPort }
EndpointSlice - implements kubernetes endpoint slice.
type EndpointSliceList ¶ added in v1.41.0
type EndpointSliceList struct { Metadata ListMeta Items []*EndpointSlice }
EndpointSliceList - implements kubernetes endpoint slice list object, that groups service endpoints slices.
type EndpointSubset ¶
type EndpointSubset struct { Addresses []EndpointAddress NotReadyAddresses []EndpointAddress Ports []EndpointPort }
EndpointSubset implements k8s endpoint subset.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#endpointsubset-v1-core
type Endpoints ¶
type Endpoints struct { Metadata ObjectMeta Subsets []EndpointSubset }
Endpoints implements k8s endpoints.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#endpoints-v1-core
type EndpointsList ¶
EndpointsList implements k8s endpoints list.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#endpointslist-v1-core
type Error ¶ added in v1.57.0
type Error struct {
Code int
}
Error is an error message from Kubernetes Watch API.
type HTTPIngressPath ¶
type HTTPIngressPath struct {
Path string
}
HTTPIngressPath represents HTTP ingress path in k8s.
type HTTPIngressRuleValue ¶
type HTTPIngressRuleValue struct {
Paths []HTTPIngressPath
}
HTTPIngressRuleValue represents HTTP ingress rule value in k8s.
type Ingress ¶
type Ingress struct { Metadata ObjectMeta Spec IngressSpec }
Ingress represents ingress in k8s.
type IngressList ¶
IngressList represents ingress list in k8s.
type IngressRule ¶
type IngressRule struct { Host string HTTP HTTPIngressRuleValue `json:"http"` }
IngressRule represents ingress rule in k8s.
type IngressSpec ¶
type IngressSpec struct { TLS []IngressTLS `json:"tls"` Rules []IngressRule }
IngressSpec represents ingress spec in k8s.
type IngressTLS ¶
type IngressTLS struct {
Hosts []string
}
IngressTLS represents ingress TLS spec in k8s.
type ListMeta ¶ added in v1.55.0
type ListMeta struct {
ResourceVersion string
}
ListMeta is a Kubernetes list metadata https://v1-17.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#listmeta-v1-meta
type Namespaces ¶ added in v1.35.0
type Namespaces struct {
Names []string `yaml:"names"`
}
Namespaces represents namespaces for SDConfig
type Node ¶
type Node struct { Metadata ObjectMeta Status NodeStatus }
Node represents Node from k8s API.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#node-v1-core
type NodeAddress ¶
NodeAddress represents NodeAddress from k8s API.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodeaddress-v1-core
type NodeDaemonEndpoints ¶
type NodeDaemonEndpoints struct {
KubeletEndpoint DaemonEndpoint
}
NodeDaemonEndpoints represents NodeDaemonEndpoints from k8s API.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodedaemonendpoints-v1-core
type NodeList ¶
NodeList represents NodeList from k8s API.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodelist-v1-core
type NodeStatus ¶
type NodeStatus struct { Addresses []NodeAddress DaemonEndpoints NodeDaemonEndpoints }
NodeStatus represents NodeStatus from k8s API.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodestatus-v1-core
type ObjectMeta ¶
type ObjectMeta struct { Name string Namespace string UID string Labels discoveryutils.SortedLabels Annotations discoveryutils.SortedLabels OwnerReferences []OwnerReference }
ObjectMeta represents ObjectMeta from k8s API.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#objectmeta-v1-meta
type ObjectReference ¶
ObjectReference implements k8s object reference.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#objectreference-v1-core
type OwnerReference ¶
OwnerReference represents OwnerReferense from k8s API.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#ownerreference-v1-meta
type Pod ¶
type Pod struct { Metadata ObjectMeta Spec PodSpec Status PodStatus }
Pod implements k8s pod.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#pod-v1-core
type PodCondition ¶
PodCondition implements k8s pod condition.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podcondition-v1-core
type PodList ¶
PodList implements k8s pod list.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podlist-v1-core
type PodSpec ¶
PodSpec implements k8s pod spec.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podspec-v1-core
type PodStatus ¶
type PodStatus struct { Phase string PodIP string HostIP string Conditions []PodCondition }
PodStatus implements k8s pod status.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podstatus-v1-core
type SDConfig ¶ added in v1.35.0
type SDConfig struct { APIServer string `yaml:"api_server,omitempty"` // Use role() function for accessing the Role field Role string `yaml:"role"` HTTPClientConfig promauth.HTTPClientConfig `yaml:",inline"` ProxyURL proxy.URL `yaml:"proxy_url,omitempty"` Namespaces Namespaces `yaml:"namespaces,omitempty"` Selectors []Selector `yaml:"selectors,omitempty"` // contains filtered or unexported fields }
SDConfig represents kubernetes-based service discovery config.
See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
func (*SDConfig) GetScrapeWorkObjects ¶ added in v1.55.0
GetScrapeWorkObjects returns ScrapeWork objects for the given sdc.
This function must be called after MustStart call.
func (*SDConfig) MustStart ¶ added in v1.58.0
func (sdc *SDConfig) MustStart(baseDir string, swcFunc ScrapeWorkConstructorFunc)
MustStart initializes sdc before its usage.
swcFunc is used for constructing such objects.
type ScrapeWorkConstructorFunc ¶ added in v1.55.0
ScrapeWorkConstructorFunc must construct ScrapeWork object for the given metaLabels.
type Selector ¶
type Selector struct { Role string `yaml:"role"` Label string `yaml:"label"` Field string `yaml:"field"` }
Selector represents kubernetes selector.
See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/ and https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
type Service ¶
type Service struct { Metadata ObjectMeta Spec ServiceSpec }
Service is k8s service.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#service-v1-core
type ServiceList ¶
ServiceList is k8s service list.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#servicelist-v1-core
type ServicePort ¶
ServicePort is k8s service port.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#serviceport-v1-core
type ServiceSpec ¶
type ServiceSpec struct { ClusterIP string ExternalName string Type string Ports []ServicePort }
ServiceSpec is k8s service spec.
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#servicespec-v1-core
type WatchEvent ¶ added in v1.55.0
type WatchEvent struct { Type string Object json.RawMessage }
WatchEvent is a watch event returned from API server endpoints if `watch=1` query arg is set.
See https://kubernetes.io/docs/reference/using-api/api-concepts/#efficient-detection-of-changes