Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kubernetes] add replicaset pods to kubernetes.pods.running metric #2444

Closed
crunchie84 opened this issue Apr 26, 2016 · 3 comments · Fixed by #2512
Closed

[kubernetes] add replicaset pods to kubernetes.pods.running metric #2444

crunchie84 opened this issue Apr 26, 2016 · 3 comments · Fixed by #2512
Assignees
Milestone

Comments

@crunchie84
Copy link

crunchie84 commented Apr 26, 2016

In PR #2277 @masci created the basics for the pod counts based on ReplicaControllers 🏆 . Since the release of Kubernetes (k8s) 1.2 this is no longer enough. The developers introduced Deployments in k8s 1.2 which work in combination with ReplicaSets instead of ReplicaControllers thus having pods be annotated as created-by ReplicaSet.

Proposed change

The pods are grouped by creator name in /checks.d/kubernetes.py. Proposed change is to have this grouping also include pods grouped by ReplicaSet. As far as i can see the naming of ReplicationControllers/ReplicaSets is unique so no overlap should be possible.

Example annotation output with new ReplicaSets:

"annotations": {
  "kubernetes.io/created-by": "{\"kind\":\"SerializedReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"ReplicaSet\",\"namespace\":\"default\",\"name\":\"myreplicaset-2962775361\",\"uid\":\"618e8a0a-07c3-11e6-855b-42010af00104\",\"apiVersion\":\"extensions\",\"resourceVersion\":\"3428\"}}\n"
}

This ticket has been created while using Kubernetes version 1.2.2

@crunchie84 crunchie84 changed the title [kubernetes] add kubernetes.pods.running metric [kubernetes] add replicaset pods to kubernetes.pods.running metric Apr 26, 2016
@crunchie84
Copy link
Author

I have created a PR for the proposed change.

@remh remh added this to the 5.8.0 milestone Apr 26, 2016
remh pushed a commit that referenced this issue May 17, 2016
- Adapt to new format of labels set by kube1.2 fix #2388 #2494
- Allow to blacklist labels
- Support replica sets fix #2444 #2446
- Handle case where no pods are running. Fix #2263
remh pushed a commit that referenced this issue May 17, 2016
- Adapt to new format of labels set by kube1.2 fix #2388 #2494
- Allow to blacklist labels
- Support replica sets fix #2444 #2446
- Handle case where no pods are running. Fix #2263
remh pushed a commit that referenced this issue May 17, 2016
- Enable kubelet check by default
- Remove master check for now as they are flaky, hard to enable and not used
- Adapt to new format of labels set by kube1.2 fix #2388 #2494
- Allow to blacklist labels
- Support replica sets fix #2444 #2446
- Handle case where no pods are running. Fix #2263
- Add tests for kube 1.2
remh pushed a commit that referenced this issue May 17, 2016
- Enable kubelet check by default
- Remove master check for now as they are flaky, hard to enable and not used
- Adapt to new format of labels set by kube1.2 fix #2388 #2494
- Allow to blacklist labels
- Support replica sets fix #2444 #2446
- Handle case where no pods are running. Fix #2263
- Add tests for kube 1.2
remh pushed a commit that referenced this issue May 17, 2016
- Enable kubelet check by default
- Remove master check for now as they are flaky, hard to enable and not used
- Adapt to new format of labels set by kube1.2 fix #2388 #2494
- Allow to blacklist labels
- Support replica sets fix #2444 #2446
- Handle case where no pods are running. Fix #2263
- Add tests for kube 1.2
remh pushed a commit that referenced this issue May 18, 2016
- Enable kubelet check by default
- Remove master check for now as they are flaky, hard to enable and not used
- Adapt to new format of labels set by kube1.2 fix #2388 #2494
- Allow to blacklist labels
- Support replica sets fix #2444 #2446
- Handle case where no pods are running. Fix #2263
- Add tests for kube 1.2
@pires
Copy link

pires commented Jun 24, 2016

Is this included in current Datadog? Using Deployments and have no data.

@therc
Copy link
Contributor

therc commented Jul 20, 2016

I don't see this, either. Running the latest :kubernetes image. Ideally, the agent should talk to the API server and figure the desired number of replicas for a ReplicaSet or Deployment, so that you can alert if they aren't 100% running for e.g. over 5 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants