Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/heartbeat] Add Heartbeat to check status of your services #5766

Merged
merged 1 commit into from
Jun 18, 2018

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented May 25, 2018

Manually verified to work by installing it like helm install ~/charts/stable/heartbeat --name hb --namespace hb and then reading logs:

$ stern --namespace hb heart
+ hb-heartbeat-zljn2 › heartbeat
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.531ZINFOinstance/beat.go:468Home path: [/usr/share/heartbeat] Config path: [/usr/share/heartbeat] Data path: [/usr/share/heartbeat/data] Logs path: [/usr/share/heartbeat/logs]
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.532ZINFOinstance/beat.go:475Beat UUID: cc04f1e7-c1a2-4e9c-beca-009539becd87
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.532ZINFOinstance/beat.go:213Setup Beat: heartbeat; Version: 6.2.4
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.534ZINFOadd_cloud_metadata/add_cloud_metadata.go:297add_cloud_metadata: hosting provider type not detected.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.534ZINFOfileout/file.go:76Initialized file output. path=/usr/share/heartbeat/data/heartbeat max_size_bytes=10240000 max_backups=5 permissions=-rw-------
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZINFOpipeline/module.go:76Beat name: hb-heartbeat-zljn2
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZWARNbeater/heartbeat.go:24Beta: Heartbeat is beta software
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZINFObeater/manager.go:110Select (active) monitor icmp
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.537ZINFO[monitoring]log/log.go:97Starting metrics logging every 30s
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.538ZINFOinstance/beat.go:301heartbeat start running.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.538ZINFObeater/heartbeat.go:56heartbeat is running! Hit CTRL-C to stop it.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:50.538ZINFO[monitoring]log/log.go:124Non-zero metrics in the last 30s{"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":40,"time":40},"total":{"ticks":70,"time":74,"value":70},"user":{"ticks":30,"time":34}},"info":{"ephemeral_id":"23539714-a27c-40bb-a124-805b7e009958","uptime":{"ms":33026}},"memstats":{"gc_next":4194304,"memory_alloc":2423104,"memory_total":4047776,"rss":22454272}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":5,"batches":5,"total":5},"type":"file","write":{"bytes":2306}},"pipeline":{"clients":1,"events":{"active":1,"published":6,"total":6},"queue":{"acked":5}}},"system":{"cpu":{"cores":2},"load":{"1":0.75,"15":0.38,"5":0.55,"norm":{"1":0.375,"15":0.19,"5":0.275}}}}}}

Templates and values.yaml is mostly similar to stable/filebeat's.
The main difference is config: in values.yaml, which directly reflects heartbeat's own configuration file.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 25, 2018
@mumoshu
Copy link
Collaborator Author

mumoshu commented May 25, 2018

/assign @viglesiasce

@mumoshu
Copy link
Collaborator Author

mumoshu commented May 25, 2018

@viglesiasce Would you mind reviewing this? Thanks!

@mumoshu mumoshu changed the title feat: stable/heartbeat to check status of your services [stable/heartbeat] Heartbeat to check status of your services May 25, 2018
@mumoshu mumoshu changed the title [stable/heartbeat] Heartbeat to check status of your services [stable/heartbeat] Add Heartbeat to check status of your services May 30, 2018
@mumoshu
Copy link
Collaborator Author

mumoshu commented Jun 1, 2018

Could anyone review this? Thanks.

path: /var/log
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
Copy link

Choose a reason for hiding this comment

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

I don't think hearbeat needs to access this folder, Filebeat uses it to retrieve logs, but metadata is retrieved from the API

- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
Copy link

Choose a reason for hiding this comment

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

these 2 variables probably come from an older version, since 6.2 we no longer need them

volumes:
- name: varlog
hostPath:
path: /var/log
Copy link

Choose a reason for hiding this comment

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

This folder isn't needed either

- name: data
hostPath:
path: /var/lib/heartbeat
type: DirectoryOrCreate
Copy link

Choose a reason for hiding this comment

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

nice, this improves our current manifests, I'll copy it to upstream ❤️

processors:
- add_cloud_metadata:

output.file:
Copy link

@exekias exekias Jun 12, 2018

Choose a reason for hiding this comment

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

How about leaving an elasticsearch output section commented out just after this one? That would help the user configuring the most common use case. Something like this:

# output.elasticsearch:
#  hosts: ["localhost:9200"]
#  protocol: "https"
#  username: "elastic"
#  password: "changeme"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good!

@mumoshu
Copy link
Collaborator Author

mumoshu commented Jun 13, 2018

@exekias Thanks for the review! Every point made sense to me / was addressed in the follow-up commits 👍

Copy link
Member

@unguiculus unguiculus left a comment

Choose a reason for hiding this comment

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

Please add a config table to the readme.

@@ -0,0 +1,77 @@
apiVersion: apps/v1beta2
Copy link
Member

Choose a reason for hiding this comment

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

Since you require K8s 1.9+ in the readme, you could go for apps/v1.

@unguiculus
Copy link
Member

/assign

Manually verified to work by installing it like `helm install ~/charts/stable/heartbeat --name hb --namespace hb` and then reading logs:

```console
$ stern --namespace hb heart
+ hb-heartbeat-zljn2 › heartbeat
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.531ZINFOinstance/beat.go:468Home path: [/usr/share/heartbeat] Config path: [/usr/share/heartbeat] Data path: [/usr/share/heartbeat/data] Logs path: [/usr/share/heartbeat/logs]
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.532ZINFOinstance/beat.go:475Beat UUID: cc04f1e7-c1a2-4e9c-beca-009539becd87
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.532ZINFOinstance/beat.go:213Setup Beat: heartbeat; Version: 6.2.4
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.534ZINFOadd_cloud_metadata/add_cloud_metadata.go:297add_cloud_metadata: hosting provider type not detected.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.534ZINFOfileout/file.go:76Initialized file output. path=/usr/share/heartbeat/data/heartbeat max_size_bytes=10240000 max_backups=5 permissions=-rw-------
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZINFOpipeline/module.go:76Beat name: hb-heartbeat-zljn2
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZWARNbeater/heartbeat.go:24Beta: Heartbeat is beta software
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZINFObeater/manager.go:110Select (active) monitor icmp
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.537ZINFO[monitoring]log/log.go:97Starting metrics logging every 30s
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.538ZINFOinstance/beat.go:301heartbeat start running.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.538ZINFObeater/heartbeat.go:56heartbeat is running! Hit CTRL-C to stop it.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:50.538ZINFO[monitoring]log/log.go:124Non-zero metrics in the last 30s{"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":40,"time":40},"total":{"ticks":70,"time":74,"value":70},"user":{"ticks":30,"time":34}},"info":{"ephemeral_id":"23539714-a27c-40bb-a124-805b7e009958","uptime":{"ms":33026}},"memstats":{"gc_next":4194304,"memory_alloc":2423104,"memory_total":4047776,"rss":22454272}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":5,"batches":5,"total":5},"type":"file","write":{"bytes":2306}},"pipeline":{"clients":1,"events":{"active":1,"published":6,"total":6},"queue":{"acked":5}}},"system":{"cpu":{"cores":2},"load":{"1":0.75,"15":0.38,"5":0.55,"norm":{"1":0.375,"15":0.19,"5":0.275}}}}}}
```

Templates and values.yaml is mostly similar to stable/filebeat's.
The main difference is `config:` in values.yaml, which directly reflects heartbeat's own configuration file.

Other changelog:

- Include the configuration table in README
- Include the commented-out elasticsearch output to support common use-cases
@mumoshu
Copy link
Collaborator Author

mumoshu commented Jun 18, 2018

@unguiculus Thanks for reviewing! I've addressed your comments in the last commit. Would you mind taking a look again?

@unguiculus
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 18, 2018
@unguiculus
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 18, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mumoshu, unguiculus

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 18, 2018
@k8s-ci-robot k8s-ci-robot merged commit 15f492d into helm:master Jun 18, 2018
@mumoshu mumoshu deleted the heartbeat branch June 20, 2018 00:30
or1can pushed a commit to or1can/charts that referenced this pull request Jul 10, 2018
Manually verified to work by installing it like `helm install ~/charts/stable/heartbeat --name hb --namespace hb` and then reading logs:

```console
$ stern --namespace hb heart
+ hb-heartbeat-zljn2 › heartbeat
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.531ZINFOinstance/beat.go:468Home path: [/usr/share/heartbeat] Config path: [/usr/share/heartbeat] Data path: [/usr/share/heartbeat/data] Logs path: [/usr/share/heartbeat/logs]
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.532ZINFOinstance/beat.go:475Beat UUID: cc04f1e7-c1a2-4e9c-beca-009539becd87
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.532ZINFOinstance/beat.go:213Setup Beat: heartbeat; Version: 6.2.4
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.534ZINFOadd_cloud_metadata/add_cloud_metadata.go:297add_cloud_metadata: hosting provider type not detected.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.534ZINFOfileout/file.go:76Initialized file output. path=/usr/share/heartbeat/data/heartbeat max_size_bytes=10240000 max_backups=5 permissions=-rw-------
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZINFOpipeline/module.go:76Beat name: hb-heartbeat-zljn2
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZWARNbeater/heartbeat.go:24Beta: Heartbeat is beta software
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZINFObeater/manager.go:110Select (active) monitor icmp
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.537ZINFO[monitoring]log/log.go:97Starting metrics logging every 30s
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.538ZINFOinstance/beat.go:301heartbeat start running.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.538ZINFObeater/heartbeat.go:56heartbeat is running! Hit CTRL-C to stop it.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:50.538ZINFO[monitoring]log/log.go:124Non-zero metrics in the last 30s{"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":40,"time":40},"total":{"ticks":70,"time":74,"value":70},"user":{"ticks":30,"time":34}},"info":{"ephemeral_id":"23539714-a27c-40bb-a124-805b7e009958","uptime":{"ms":33026}},"memstats":{"gc_next":4194304,"memory_alloc":2423104,"memory_total":4047776,"rss":22454272}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":5,"batches":5,"total":5},"type":"file","write":{"bytes":2306}},"pipeline":{"clients":1,"events":{"active":1,"published":6,"total":6},"queue":{"acked":5}}},"system":{"cpu":{"cores":2},"load":{"1":0.75,"15":0.38,"5":0.55,"norm":{"1":0.375,"15":0.19,"5":0.275}}}}}}
```

Templates and values.yaml is mostly similar to stable/filebeat's.
The main difference is `config:` in values.yaml, which directly reflects heartbeat's own configuration file.

Other changelog:

- Include the configuration table in README
- Include the commented-out elasticsearch output to support common use-cases
voron pushed a commit to dysnix/helm-charts that referenced this pull request Sep 5, 2018
Manually verified to work by installing it like `helm install ~/charts/stable/heartbeat --name hb --namespace hb` and then reading logs:

```console
$ stern --namespace hb heart
+ hb-heartbeat-zljn2 › heartbeat
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.531ZINFOinstance/beat.go:468Home path: [/usr/share/heartbeat] Config path: [/usr/share/heartbeat] Data path: [/usr/share/heartbeat/data] Logs path: [/usr/share/heartbeat/logs]
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.532ZINFOinstance/beat.go:475Beat UUID: cc04f1e7-c1a2-4e9c-beca-009539becd87
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:17.532ZINFOinstance/beat.go:213Setup Beat: heartbeat; Version: 6.2.4
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.534ZINFOadd_cloud_metadata/add_cloud_metadata.go:297add_cloud_metadata: hosting provider type not detected.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.534ZINFOfileout/file.go:76Initialized file output. path=/usr/share/heartbeat/data/heartbeat max_size_bytes=10240000 max_backups=5 permissions=-rw-------
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZINFOpipeline/module.go:76Beat name: hb-heartbeat-zljn2
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZWARNbeater/heartbeat.go:24Beta: Heartbeat is beta software
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.535ZINFObeater/manager.go:110Select (active) monitor icmp
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.537ZINFO[monitoring]log/log.go:97Starting metrics logging every 30s
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.538ZINFOinstance/beat.go:301heartbeat start running.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:20.538ZINFObeater/heartbeat.go:56heartbeat is running! Hit CTRL-C to stop it.
hb-heartbeat-zljn2 heartbeat 2018-05-25T09:07:50.538ZINFO[monitoring]log/log.go:124Non-zero metrics in the last 30s{"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":40,"time":40},"total":{"ticks":70,"time":74,"value":70},"user":{"ticks":30,"time":34}},"info":{"ephemeral_id":"23539714-a27c-40bb-a124-805b7e009958","uptime":{"ms":33026}},"memstats":{"gc_next":4194304,"memory_alloc":2423104,"memory_total":4047776,"rss":22454272}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":5,"batches":5,"total":5},"type":"file","write":{"bytes":2306}},"pipeline":{"clients":1,"events":{"active":1,"published":6,"total":6},"queue":{"acked":5}}},"system":{"cpu":{"cores":2},"load":{"1":0.75,"15":0.38,"5":0.55,"norm":{"1":0.375,"15":0.19,"5":0.275}}}}}}
```

Templates and values.yaml is mostly similar to stable/filebeat's.
The main difference is `config:` in values.yaml, which directly reflects heartbeat's own configuration file.

Other changelog:

- Include the configuration table in README
- Include the commented-out elasticsearch output to support common use-cases

Signed-off-by: voron <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants