Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
2.0 release (#117)
Browse files Browse the repository at this point in the history
* Stash to GitHub (#92)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve (#94)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve

Dev-40217 support to set log levels and improve

* bump version

* Remove beta tag (#97)

* Develop (#95)

* Stash to GitHub (#92)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve (#94)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve

Dev-40217 support to set log levels and improve

* bump version

* remove beta tag

* Dev 42060  improve the initSync and the branch of the lm sdk (#98)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-42060: Don't create collector device for Kubernetes Clusters

* Update pkg/device/device.go

Co-Authored-By: JeremyTangCD <[email protected]>

* Update pkg/device/device.go

Co-Authored-By: JeremyTangCD <[email protected]>

* Update device.go

* Dev 49046 fix the internal ip cannot found (#102)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve

Dev-40217 support to set log levels and improve

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-42060: Don't create collector device for Kubernetes Clusters

* DEV-47062 Add distinguishing property to host network pods

* DEV-49046 Fix the internal IP cannot found bug in argus

* DEV-49046 Fix the internal IP cannot found bug in argus

* Update node_test.go

* DEV-48974 Upgrade the go version of the argus from 1.9 to 1.11 (#104)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve

Dev-40217 support to set log levels and improve

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-42060: Don't create collector device for Kubernetes Clusters

* DEV-47062 Add distinguishing property to host network pods

* DEV-49046 Fix the internal IP cannot found bug in argus

* DEV-49046 Fix the internal IP cannot found bug in argus

* Update node_test.go

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* Develop (#108)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve

Dev-40217 support to set log levels and improve

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-42060: Don't create collector device for Kubernetes Clusters

* DEV-47062 Add distinguishing property to host network pods

* DEV-49046 Fix the internal IP cannot found bug in argus

* DEV-49046 Fix the internal IP cannot found bug in argus

* Update node_test.go

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-49251 improve panic log process

* DEV-50734 Support all service type, and add the logs

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-50734 Support all service type, modify the UpdateFunc

* DEV-41301 Upgrade the go sdk to v2

* DEV-49251 Add the defer to initSync and improve log output

* DEV-41301 Upgrade the go sdk to v2

* DEV-50734 Improve the log message

* DEV-49251 Improve the log message

* DEV-49251 Improve the comments

* DEV-51405 Fix the argus log format

* DEV-51567 Fixed the label value of k8s monitored

* Modify the format by Travis CI check

* DEV-51677 Improve the code according to github comments

* Improve the variable naming

* Add deployment and device uptime support (#110)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve

Dev-40217 support to set log levels and improve

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-42060: Don't create collector device for Kubernetes Clusters

* DEV-47062 Add distinguishing property to host network pods

* DEV-49046 Fix the internal IP cannot found bug in argus

* DEV-49046 Fix the internal IP cannot found bug in argus

* Update node_test.go

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-49251 improve panic log process

* DEV-50734 Support all service type, and add the logs

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-50734 Support all service type, modify the UpdateFunc

* DEV-41301 Upgrade the go sdk to v2

* DEV-50929 Add k8s deployments monitoring by Argus

* DEV-49251 Add the defer to initSync and improve log output

* DEV-41301 Upgrade the go sdk to v2

* DEV-50929 Improve the code with comments

* DEV-50734 Improve the log message

* DEV-49251 Improve the log message

* DEV-49251 Improve the comments

* DEV-51405 Fix the argus log format

* DEV-51567 Fixed the label value of k8s monitored

* DEV-49675 Synchronous develop branch, add the recover panic logic for deployments

* Modify the format by Travis CI check

* DEV-51677 Improve the code according to github comments

* Improve the variable naming

* DEV-51932 fix uptime widget for k8s resources

* DEV-49675 Restore the dockerfile

* DEV-52508 Fixed the CI check

* DEV-52508 Argus deployment rbac privilege improve

* DEV-52508 Argus deployment rbac privilege improve

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52508 Improve by the comments

* DEV-52508 Fix the comments

* DEV-52508 Fix the comments

* remove logo link

* Develop (#112)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve

Dev-40217 support to set log levels and improve

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-42060: Don't create collector device for Kubernetes Clusters

* DEV-47062 Add distinguishing property to host network pods

* DEV-49046 Fix the internal IP cannot found bug in argus

* DEV-49046 Fix the internal IP cannot found bug in argus

* Update node_test.go

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-49251 improve panic log process

* DEV-50734 Support all service type, and add the logs

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-50734 Support all service type, modify the UpdateFunc

* DEV-41301 Upgrade the go sdk to v2

* DEV-50929 Add k8s deployments monitoring by Argus

* DEV-49251 Add the defer to initSync and improve log output

* DEV-41301 Upgrade the go sdk to v2

* DEV-50929 Improve the code with comments

* DEV-50734 Improve the log message

* DEV-49251 Improve the log message

* DEV-49251 Improve the comments

* DEV-51405 Fix the argus log format

* DEV-51567 Fixed the label value of k8s monitored

* DEV-49675 Synchronous develop branch, add the recover panic logic for deployments

* Modify the format by Travis CI check

* DEV-51677 Improve the code according to github comments

* Improve the variable naming

* DEV-51932 fix uptime widget for k8s resources

* DEV-49675 Restore the dockerfile

* DEV-52508 Fixed the CI check

* DEV-52508 Argus deployment rbac privilege improve

* DEV-52508 Argus deployment rbac privilege improve

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52508 Improve by the comments

* DEV-52508 Fix the comments

* DEV-52508 Fix the comments

* remove logo link

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52036 Fix the comments

* DEV-52036 Fix the comments

* DEV-52991 Add UT

* Develop (#114)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve

Dev-40217 support to set log levels and improve

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-42060: Don't create collector device for Kubernetes Clusters

* DEV-47062 Add distinguishing property to host network pods

* DEV-49046 Fix the internal IP cannot found bug in argus

* DEV-49046 Fix the internal IP cannot found bug in argus

* Update node_test.go

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-49251 improve panic log process

* DEV-50734 Support all service type, and add the logs

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-50734 Support all service type, modify the UpdateFunc

* DEV-41301 Upgrade the go sdk to v2

* DEV-50929 Add k8s deployments monitoring by Argus

* DEV-49251 Add the defer to initSync and improve log output

* DEV-41301 Upgrade the go sdk to v2

* DEV-50929 Improve the code with comments

* DEV-50734 Improve the log message

* DEV-49251 Improve the log message

* DEV-49251 Improve the comments

* DEV-51405 Fix the argus log format

* DEV-51567 Fixed the label value of k8s monitored

* DEV-49675 Synchronous develop branch, add the recover panic logic for deployments

* Modify the format by Travis CI check

* DEV-51677 Improve the code according to github comments

* Improve the variable naming

* DEV-51932 fix uptime widget for k8s resources

* DEV-49675 Restore the dockerfile

* DEV-52508 Fixed the CI check

* DEV-52508 Argus deployment rbac privilege improve

* DEV-52508 Argus deployment rbac privilege improve

* DEV-51952 Research argus http & http proxy configuration options

* DEV-51952 Research argus http & http proxy configuration options

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52508 Improve by the comments

* DEV-52508 Fix the comments

* DEV-52508 Fix the comments

* DEV-52044 Add http proxy for argus

* remove logo link

* DEV-52044 Add http proxy for argus

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52044 Add httpURL parameter description

* DEV-52044 Add httpURL parameter description

* DEV-52044 Fix the comments

* DEV-52044 Fix the comments

* DEV-52036 Fix the comments

* DEV-52044 Improve the http proxy configuration

* DEV-52044 Improve the http proxy configuration

* DEV-52036 Fix the comments

* DEV-52991 Add UT

* DEV-52692 fix the comments

* DEV-52692 fix the comments

* DEV-52692 Support proxy for dockerized collector

* DEV-53516 Create PR for supporting http proxy configuration

* Dev 55114 argus shouldn t overwrite system.categories values (#116)

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-39965: Allow the user to specify a parent group during installation

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40434: The alert status of Pods and Services are disabled

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40505: Sync the k8s resource to santaba when argus launches

* DEV-40779: Enable the alert on service group when it is created by argus

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-41459: Add a new device type for k8s devices

* DEV-41432: Use IP as hostname for argus related devices

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-40217: Support to set log levels and improve logs in argus related projects

* DEV-41682: Improve the argus code for the CI failure in GitHub

* Dev-40217 support to set log levels and improve

Dev-40217 support to set log levels and improve

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-41947: Improve the initsync logic to prevent lost data after k8s device is updated

* DEV-42060: Don't create collector device for Kubernetes Clusters

* DEV-47062 Add distinguishing property to host network pods

* DEV-49046 Fix the internal IP cannot found bug in argus

* DEV-49046 Fix the internal IP cannot found bug in argus

* Update node_test.go

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-48974 Upgrade Argus from golang 1.9 to 1.11

* DEV-49251 improve panic log process

* DEV-50734 Support all service type, and add the logs

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-41301 Upgrade the go sdk to v2

* DEV-50734 Support all service type, modify the UpdateFunc

* DEV-41301 Upgrade the go sdk to v2

* DEV-50929 Add k8s deployments monitoring by Argus

* DEV-49251 Add the defer to initSync and improve log output

* DEV-41301 Upgrade the go sdk to v2

* DEV-50929 Improve the code with comments

* DEV-50734 Improve the log message

* DEV-49251 Improve the log message

* DEV-49251 Improve the comments

* DEV-51405 Fix the argus log format

* DEV-51567 Fixed the label value of k8s monitored

* DEV-49675 Synchronous develop branch, add the recover panic logic for deployments

* Modify the format by Travis CI check

* DEV-51677 Improve the code according to github comments

* Improve the variable naming

* DEV-51932 fix uptime widget for k8s resources

* DEV-49675 Restore the dockerfile

* DEV-52508 Fixed the CI check

* DEV-52508 Argus deployment rbac privilege improve

* DEV-52508 Argus deployment rbac privilege improve

* DEV-51952 Research argus http & http proxy configuration options

* DEV-51952 Research argus http & http proxy configuration options

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52508 Argus deployment rbac privilege compatibility improvement

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52508 Improve by the comments

* DEV-52508 Fix the comments

* DEV-52508 Fix the comments

* DEV-52044 Add http proxy for argus

* remove logo link

* DEV-52044 Add http proxy for argus

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52036 Allow for duplicate pod names in one LM account

* DEV-52044 Add httpURL parameter description

* DEV-52044 Add httpURL parameter description

* DEV-52044 Fix the comments

* DEV-52044 Fix the comments

* DEV-52036 Fix the comments

* DEV-52044 Improve the http proxy configuration

* DEV-52044 Improve the http proxy configuration

* DEV-52036 Fix the comments

* DEV-52991 Add UT

* DEV-52692 fix the comments

* DEV-52692 fix the comments

* DEV-52692 Support proxy for dockerized collector

* DEV-53516 Create PR for supporting http proxy configuration

* DEV-55114 Argus shouldn't overwrite system.categories values

* DEV-55114 Argus shouldn't overwrite system.categories values

* DEV-55114 Argus shouldn't overwrite system.categories values

* DEV-55114 Argus shouldn't overwrite system.categories values

* DEV-55114 Argus shouldn't overwrite system.categories values
  • Loading branch information
Jeff authored Dec 13, 2019
1 parent 5877f8f commit 2485561
Show file tree
Hide file tree
Showing 11 changed files with 164 additions and 66 deletions.
2 changes: 2 additions & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ const (
K8sResourceCreatedOnPropertyKey = "kubernetes.resourceCreatedOn"
// K8sDeviceType is the type value of the k8s device
K8sDeviceType = 8
// K8sSystemCategoriesPropertyKey is the key of the unique custom property kubernetes system categories
K8sSystemCategoriesPropertyKey = "system.categories"
)

const (
Expand Down
55 changes: 50 additions & 5 deletions pkg/device/builder/builder.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package builder

import (
"strings"

"github.com/logicmonitor/k8s-argus/pkg/constants"
"github.com/logicmonitor/k8s-argus/pkg/types"
"github.com/logicmonitor/lm-sdk-go/models"
Expand Down Expand Up @@ -35,22 +37,38 @@ func (b *Builder) CollectorID(id int32) types.DeviceOption {

// SystemCategories implements types.DeviceBuilder
func (b *Builder) SystemCategories(categories string) types.DeviceOption {
return setProperty("system.categories", categories)
return setProperty(constants.K8sSystemCategoriesPropertyKey, categories)
}

// ResourceLabels implements types.DeviceBuilder
func (b *Builder) ResourceLabels(properties map[string]string) types.DeviceOption {
return func(device *models.Device) {
if device == nil {
return
}
if device.CustomProperties == nil {
device.CustomProperties = []*models.NameAndValue{}
}
for name, value := range properties {
propName := constants.LabelCustomPropertyPrefix + name
propValue := value
if propValue == "" {
propValue = constants.LabelNullPlaceholder
}
device.CustomProperties = append(device.CustomProperties, &models.NameAndValue{
Name: &propName,
Value: &propValue,
})
existed := false
for _, prop := range device.CustomProperties {
if *prop.Name == propName {
*prop.Value = propValue
existed = true
break
}
}
if !existed {
device.CustomProperties = append(device.CustomProperties, &models.NameAndValue{
Name: &propName,
Value: &propValue,
})
}
}
}
}
Expand All @@ -72,6 +90,21 @@ func (b *Builder) Custom(name, value string) types.DeviceOption {

func setProperty(name, value string) types.DeviceOption {
return func(device *models.Device) {
if device == nil {
return
}
if device.CustomProperties == nil {
device.CustomProperties = []*models.NameAndValue{}
}
for _, prop := range device.CustomProperties {
if *prop.Name == name && value != "" {
if *prop.Name == constants.K8sSystemCategoriesPropertyKey {
value = getUpdatedSystemCategories(*prop.Value, value)
}
*prop.Value = value
return
}
}
if value != "" {
device.CustomProperties = append(device.CustomProperties, &models.NameAndValue{
Name: &name,
Expand All @@ -82,3 +115,15 @@ func setProperty(name, value string) types.DeviceOption {
}
}
}

func getUpdatedSystemCategories(oldValue, newValue string) string {
// we do not use strings.contain, because it may be matched as substring of some prop
oldValues := strings.Split(strings.TrimSpace(oldValue), ",")
for _, ov := range oldValues {
if ov == newValue {
return oldValue
}
}
oldValue = oldValue + "," + newValue
return oldValue
}
62 changes: 62 additions & 0 deletions pkg/device/builder/builder_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package builder

import (
"testing"

"github.com/logicmonitor/k8s-argus/pkg/constants"
"github.com/logicmonitor/lm-sdk-go/models"
)

func TestBuilder_SetProperty(t *testing.T) {
propName := "name"
propValue1 := "value1"
propValue2 := "value2"
device := &models.Device{
CustomProperties: []*models.NameAndValue{},
}

setProp := setProperty(propName, propValue1)
setProp(device)
if propValue1 != getDevicePropValueByName(device, propName) {
t.Errorf("failed to set prop %s:%s to the device", propName, propValue1)
}
setProp = setProperty(propName, propValue2)
setProp(device)
if propValue2 != getDevicePropValueByName(device, propName) {
t.Errorf("failed to set prop %s:%s to the device", propName, propValue2)
}

sysPropValue1 := "k1=v1,k2=v2"
sysPropValue2 := constants.PodCategory

setProp = setProperty(constants.K8sSystemCategoriesPropertyKey, sysPropValue1)
setProp(device)
if propValue2 != getDevicePropValueByName(device, propName) {
t.Errorf("failed to set prop %s:%s to the device", propName, propValue2)
}
if sysPropValue1 != getDevicePropValueByName(device, constants.K8sSystemCategoriesPropertyKey) {
t.Errorf("failed to set prop %s:%s to the device", constants.K8sSystemCategoriesPropertyKey, sysPropValue1)
}
setProp = setProperty(constants.K8sSystemCategoriesPropertyKey, sysPropValue2)
setProp(device)
if sysPropValue1+","+constants.PodCategory != getDevicePropValueByName(device, constants.K8sSystemCategoriesPropertyKey) {
t.Errorf("failed to set prop %s:%s to the device", constants.K8sSystemCategoriesPropertyKey, sysPropValue2)
}
setProp = setProperty(constants.K8sSystemCategoriesPropertyKey, sysPropValue2)
setProp(device)
if sysPropValue1+","+constants.PodCategory != getDevicePropValueByName(device, constants.K8sSystemCategoriesPropertyKey) {
t.Errorf("failed to set prop %s:%s to the device", constants.K8sSystemCategoriesPropertyKey, sysPropValue2)
}
}

func getDevicePropValueByName(d *models.Device, name string) string {
if d == nil || d.CustomProperties == nil {
return ""
}
for _, prop := range d.CustomProperties {
if *prop.Name == name {
return *prop.Value
}
}
return ""
}
76 changes: 41 additions & 35 deletions pkg/device/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,42 @@ type Manager struct {
ControllerClient api.CollectorSetControllerClient
}

func buildDevice(c *config.Config, client api.CollectorSetControllerClient, options ...types.DeviceOption) *models.Device {
hostGroupIds := "1"
propertyName := constants.K8sClusterNamePropertyKey
// use the copy value
clusterName := c.ClusterName
device := &models.Device{
CustomProperties: []*models.NameAndValue{
{
Name: &propertyName,
Value: &clusterName,
func buildDevice(c *config.Config, client api.CollectorSetControllerClient, d *models.Device, options ...types.DeviceOption) *models.Device {
if d == nil {
hostGroupIds := "1"
propertyName := constants.K8sClusterNamePropertyKey
// use the copy value
clusterName := c.ClusterName
d = &models.Device{
CustomProperties: []*models.NameAndValue{
{
Name: &propertyName,
Value: &clusterName,
},
},
},
DisableAlerting: c.DisableAlerting,
HostGroupIds: &hostGroupIds,
DeviceType: constants.K8sDeviceType,
}
DisableAlerting: c.DisableAlerting,
HostGroupIds: &hostGroupIds,
DeviceType: constants.K8sDeviceType,
}

for _, option := range options {
option(device)
}
for _, option := range options {
option(d)
}

reply, err := client.CollectorID(context.Background(), &api.CollectorIDRequest{})
if err != nil {
log.Errorf("Failed to get collector ID: %v", err)
reply, err := client.CollectorID(context.Background(), &api.CollectorIDRequest{})
if err != nil {
log.Errorf("Failed to get collector ID: %v", err)
} else {
log.Infof("Using collector ID %d for %q", reply.Id, *d.DisplayName)
d.PreferredCollectorID = &reply.Id
}
} else {
log.Infof("Using collector ID %d for %q", reply.Id, *device.DisplayName)
device.PreferredCollectorID = &reply.Id
for _, option := range options {
option(d)
}
}

return device
return d
}

// checkAndUpdateExistingDevice tries to find and update the devices which needs to be changed
Expand Down Expand Up @@ -210,7 +216,7 @@ func (m *Manager) FindByDisplayNameAndClusterName(displayName string) (*models.D

// Add implements types.DeviceManager.
func (m *Manager) Add(options ...types.DeviceOption) (*models.Device, error) {
device := buildDevice(m.Config(), m.ControllerClient, options...)
device := buildDevice(m.Config(), m.ControllerClient, nil, options...)
log.Debugf("%#v", device)

params := lm.NewAddDeviceParams()
Expand Down Expand Up @@ -239,12 +245,12 @@ func (m *Manager) Add(options ...types.DeviceOption) (*models.Device, error) {
return restResponse.Payload, nil
}

// UpdateAndReplaceByID implements types.DeviceManager.
func (m *Manager) UpdateAndReplaceByID(id int32, options ...types.DeviceOption) (*models.Device, error) {
device := buildDevice(m.Config(), m.ControllerClient, options...)
// UpdateAndReplace implements types.DeviceManager.
func (m *Manager) UpdateAndReplace(d *models.Device, options ...types.DeviceOption) (*models.Device, error) {
device := buildDevice(m.Config(), m.ControllerClient, d, options...)
log.Debugf("%#v", device)

return m.updateAndReplace(id, device)
return m.updateAndReplace(d.ID, device)
}

// UpdateAndReplaceByDisplayName implements types.DeviceManager.
Expand All @@ -260,7 +266,7 @@ func (m *Manager) UpdateAndReplaceByDisplayName(name string, options ...types.De
}
options = append(options, m.DisplayName(*d.DisplayName))
// Update the device.
device, err := m.UpdateAndReplaceByID(d.ID, options...)
device, err := m.UpdateAndReplace(d, options...)
if err != nil {
return nil, err
}
Expand All @@ -270,13 +276,13 @@ func (m *Manager) UpdateAndReplaceByDisplayName(name string, options ...types.De

// TODO: this method needs to be removed in DEV-50496

// UpdateAndReplaceFieldByID implements types.DeviceManager.
func (m *Manager) UpdateAndReplaceFieldByID(id int32, field string, options ...types.DeviceOption) (*models.Device, error) {
device := buildDevice(m.Config(), m.ControllerClient, options...)
// UpdateAndReplaceField implements types.DeviceManager.
func (m *Manager) UpdateAndReplaceField(d *models.Device, field string, options ...types.DeviceOption) (*models.Device, error) {
device := buildDevice(m.Config(), m.ControllerClient, d, options...)
log.Debugf("%#v", device)

params := lm.NewPatchDeviceParams()
params.SetID(id)
params.SetID(d.ID)
params.SetBody(device)
opType := "replace"
params.SetOpType(&opType)
Expand Down Expand Up @@ -304,7 +310,7 @@ func (m *Manager) UpdateAndReplaceFieldByDisplayName(name string, field string,
}
options = append(options, m.DisplayName(*d.DisplayName))
// Update the device.
device, err := m.UpdateAndReplaceFieldByID(d.ID, field, options...)
device, err := m.UpdateAndReplaceField(d, field, options...)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions pkg/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/coreos/etcd/client"
"github.com/logicmonitor/k8s-argus/pkg/constants"
"github.com/logicmonitor/k8s-argus/pkg/types"
"github.com/logicmonitor/k8s-argus/pkg/utilities"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -86,11 +85,10 @@ func (c *Controller) addDevice(member *Member) {

// nolint: unparam
func (c *Controller) args(member *Member, category string) []types.DeviceOption {
categories := utilities.BuildSystemCategoriesFromLabels(category, nil)
return []types.DeviceOption{
c.Name(member.URL.Hostname()),
c.DisplayName(fmtMemberDisplayName(member)),
c.SystemCategories(categories),
c.SystemCategories(category),
c.Auto("clientport", member.URL.Port()),
}
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ type DeviceMapper interface {
FindByDisplayNameAndClusterName(string) (*models.Device, error)
// Add adds a device to a LogicMonitor account.
Add(...DeviceOption) (*models.Device, error)
// UpdateAndReplaceByID updates a device using the 'replace' OpType.
UpdateAndReplaceByID(int32, ...DeviceOption) (*models.Device, error)
// UpdateAndReplace updates a device using the 'replace' OpType.
UpdateAndReplace(*models.Device, ...DeviceOption) (*models.Device, error)
// UpdateAndReplaceByDisplayName updates a device using the 'replace' OpType if and onlt if it does not already exist.
UpdateAndReplaceByDisplayName(string, ...DeviceOption) (*models.Device, error)
// UpdateAndReplaceFieldByID updates a device using the 'replace' OpType for a
// UpdateAndReplaceField updates a device using the 'replace' OpType for a
// specific field of a device.
UpdateAndReplaceFieldByID(int32, string, ...DeviceOption) (*models.Device, error)
UpdateAndReplaceField(*models.Device, string, ...DeviceOption) (*models.Device, error)
// UpdateAndReplaceFieldByDisplayName updates a device using the 'replace' OpType for a
// specific field of a device.
UpdateAndReplaceFieldByDisplayName(string, string, ...DeviceOption) (*models.Device, error)
Expand Down
8 changes: 0 additions & 8 deletions pkg/utilities/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ import (
"regexp"
)

// BuildSystemCategoriesFromLabels formats a system.categories string.
func BuildSystemCategoriesFromLabels(categories string, labels map[string]string) string {
for k, v := range labels {
categories += "," + k + "=" + v
}
return categories
}

// GetLabelByPrefix takes a list of labels returns the first label matching the specified prefix
func GetLabelByPrefix(prefix string, labels map[string]string) (string, string) {
for k, v := range labels {
Expand Down
4 changes: 1 addition & 3 deletions pkg/watch/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/logicmonitor/k8s-argus/pkg/constants"
"github.com/logicmonitor/k8s-argus/pkg/permission"
"github.com/logicmonitor/k8s-argus/pkg/types"
"github.com/logicmonitor/k8s-argus/pkg/utilities"
log "github.com/sirupsen/logrus"
"k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -116,12 +115,11 @@ func (w *Watcher) move(deployment *v1beta2.Deployment) {
}

func (w *Watcher) args(deployment *v1beta2.Deployment, category string) []types.DeviceOption {
categories := utilities.BuildSystemCategoriesFromLabels(category, deployment.Labels)
return []types.DeviceOption{
w.Name(deployment.Name),
w.ResourceLabels(deployment.Labels),
w.DisplayName(fmtDeploymentDisplayName(deployment)),
w.SystemCategories(categories),
w.SystemCategories(category),
w.Auto("name", deployment.Name),
w.Auto("namespace", deployment.Namespace),
w.Auto("selflink", deployment.SelfLink),
Expand Down
3 changes: 1 addition & 2 deletions pkg/watch/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,11 @@ func (w *Watcher) move(node *v1.Node) {
}

func (w *Watcher) args(node *v1.Node, category string) []types.DeviceOption {
categories := utilities.BuildSystemCategoriesFromLabels(category, node.Labels)
return []types.DeviceOption{
w.Name(getInternalAddress(node.Status.Addresses).Address),
w.ResourceLabels(node.Labels),
w.DisplayName(node.Name),
w.SystemCategories(categories),
w.SystemCategories(category),
w.Auto("name", node.Name),
w.Auto("selflink", node.SelfLink),
w.Auto("uid", string(node.UID)),
Expand Down
Loading

0 comments on commit 2485561

Please sign in to comment.