-
Notifications
You must be signed in to change notification settings - Fork 23
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
Technical/gh 297 update metrics #569
Conversation
….0.8, common to v0.7.0
helper/sshutil/session_pool.go
Outdated
@@ -33,15 +33,17 @@ type pool struct { | |||
mu sync.Mutex | |||
} | |||
|
|||
// Open starts a new SSH session on the given server, reusing | |||
const SSH_CONNECTION_POOL = "ssh-connections-pool" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
Code Climate has analyzed commit a93fa42 and detected 0 issues on this pull request. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good !
SonarCloud Quality Gate failed. 0 Bugs |
Pull Request description
Description of the change
What I did
Upgrade armon/go-metrics to v0.30.
Redefine Yorc metrics names. Also use labels.
Update Yorc Telemetry chapter in Yorc documentation.
How I did it
In case of metrics that are identified by a name + some labels, I replaced the previousely called go-metrics function calls by the their variant that supports labels.
For example :
metrics.IncrCounter([]string{"name-part1", "name-part2", "status"}), 1)
replaces by
metrics.IncrCounterWithLabels(([]string{"name-part1", "name-part2"}), 1, lablels)
where
labels contain a label with Name = "status" and Value = getStatus()
How to verify it
Yorc telemetry config:
"telemetry": { "service_name": "myyorc", "disable_hostname": true, "disable_go_runtime_metrics": true, "expose_prometheus_endpoint": true }
Deploy an application.
Check for metrcis on Yorc endpoint:
$ curl --noproxy '*' -v -H "Content-Type: application/json" "http://localhost:8800/metrics
Example of metrics:
myyorc_http_duration_sum{method="GET",path="metrics"} 222.54512375593185
myyorc_http_duration_count{method="GET",path="metrics"} 68
myyorc_http_total{method="GET",path="deployments",status="0"} 1
Install and start Prometheus with scrape config:
scrape_configs section in prometheus.yml config file:
static_configs:
Check for metrcis on endpoint exposed for Prometheus:
$ curl --noproxy '*' -v -H "Content-Type: application/json" "http://localhost:9090/metrics
or execute a query in Prometheus console, for example:
myyorc_http_total
Description for the changelog
Applicable Issues
#297
#507