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

Submit k_state.nodes.by_condition as gauge instead of counter #1840

Merged
merged 1 commit into from
Jul 12, 2018

Conversation

xvello
Copy link
Contributor

@xvello xvello commented Jul 3, 2018

What does this PR do?

Because AgentCheck.count() will submit the resulting count as a counter instead of a gauge, this PR moves to an internal use of a collections.Counter(), to submit node counts as gauge.

Motivation

Ensure the metric type is correct. Upgrading all agents will be necessary for the correct type to be consistently picked up.

Review checklist

  • PR has a meaningful title or PR has the no-changelog label attached
  • Feature or bugfix has tests
  • Git history is clean
    - [ ] If PR impacts documentation, docs team has been notified or an issue has been opened on the documentation repo

Additional Notes

Anything else we should know when reviewing?

@xvello
Copy link
Contributor Author

xvello commented Jul 3, 2018

On a three-node cluster:

    {
      "metric": "kubernetes_state.nodes.by_condition",
      "points": [
        [
          1530634931,
          0
        ]
      ],
      "tags": [
        "condition:DiskPressure",
        "status:unknown"
      ],
      "host": "gke-xvello-110-default-pool-ee890f07-1s1k.c.datadog-sandbox.internal",
      "type": "gauge",
      "interval": 0,
      "source_type_name": "System"
    },
    },
    {
      "metric": "kubernetes_state.nodes.by_condition",
      "points": [
        [
          1530634931,
          0
        ]
      ],
      "tags": [
        "condition:DiskPressure",
        "status:true"
      ],
      "host": "gke-xvello-110-default-pool-ee890f07-1s1k.c.datadog-sandbox.internal",
      "type": "gauge",
      "interval": 0,
      "source_type_name": "System"
    },
    {
      "metric": "kubernetes_state.nodes.by_condition",
      "points": [
        [
          1530634931,
          3
        ]
      ],
      "tags": [
        "condition:DiskPressure",
        "status:false"
      ],
      "host": "gke-xvello-110-default-pool-ee890f07-1s1k.c.datadog-sandbox.internal",
      "type": "gauge",
      "interval": 0,
      "source_type_name": "System"
    },

Copy link
Member

@hkaj hkaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍰

@xvello xvello merged commit 07d8f13 into master Jul 12, 2018
@xvello xvello deleted the xvello/ksm-counts branch July 12, 2018 13:22
@xvello xvello modified the milestones: 6.3.3, 6.4.0 Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants