Skip to content

Fixes to metrics docs#24200

Merged
pschisa merged 4 commits intomasterfrom
pschisa-patch-4
Apr 7, 2023
Merged

Fixes to metrics docs#24200
pschisa merged 4 commits intomasterfrom
pschisa-patch-4

Conversation

@pschisa
Copy link
Copy Markdown
Contributor

@pschisa pschisa commented Apr 6, 2023

Based on my testing, setting Teleport in debug mode is not required to expose the metrics

# cat /etc/systemd/system/teleport.service
ExecStart=/usr/local/bin/teleport start  --config=/etc/teleport.yaml --diag-addr=http://172.31.36.239:3434 --pid-file=/run/teleport/teleport.pid

# cat /etc/teleport.yaml
teleport:
  log:
    severity: INFO

# curl http://172.31.36.239:3434/metrics | more
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0# HELP audit_failed_disk_monitoring Number of times disk monitoring failed.
# TYPE audit_failed_disk_monitoring counter
audit_failed_disk_monitoring 0
# HELP audit_failed_emit_events Number of times emitting audit event failed.
# TYPE audit_failed_emit_events counter
audit_failed_emit_events 0
# HELP audit_percentage_disk_space_used Percentage disk space used.
# TYPE audit_percentage_disk_space_used gauge
audit_percentage_disk_space_used 100
# HELP audit_server_open_files Number of open audit files
# TYPE audit_server_open_files gauge
audit_server_open_files 0
...

# teleport version
Teleport Enterprise v12.1.2 git:api/v12.1.2-0-gbfd4ff0 go1.20.

Also, curling the diag endpoint without the metrics part returns a 404 page not found which is a confusing way to validate it is working

# curl http://172.31.36.239:3434/
404 page not found

Based on my testing, setting Teleport in debug mode is not required to expose the metrics

~~~
# cat /etc/systemd/system/teleport.service
ExecStart=/usr/local/bin/teleport start  --config=/etc/teleport.yaml --diag-addr=http://172.31.36.239:3434 --pid-file=/run/teleport/teleport.pid

# cat /etc/teleport.yaml
teleport:
  log:
    severity: INFO

# curl http://172.31.36.239:3434/metrics | more
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0# HELP audit_failed_disk_monitoring Number of times disk monitoring failed.
# TYPE audit_failed_disk_monitoring counter
audit_failed_disk_monitoring 0
# HELP audit_failed_emit_events Number of times emitting audit event failed.
# TYPE audit_failed_emit_events counter
audit_failed_emit_events 0
# HELP audit_percentage_disk_space_used Percentage disk space used.
# TYPE audit_percentage_disk_space_used gauge
audit_percentage_disk_space_used 100
# HELP audit_server_open_files Number of open audit files
# TYPE audit_server_open_files gauge
audit_server_open_files 0
...
~~~

Also, curling the diag endpoint without the metrics part returns a 404 page not found which is a confusing way to validate it is working

~~~
# curl http://172.31.36.239:3434/
404 page not found
~~~
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy left a comment

Choose a reason for hiding this comment

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

This is included in several diagnostics pages, some of which do actually require --debug in order to work(most notably collecting pprof profiles).

@zmb3 zmb3 self-requested a review April 6, 2023 14:48
@pschisa
Copy link
Copy Markdown
Contributor Author

pschisa commented Apr 6, 2023

hmmm so this might not be a simple change after all. I'll check how the doc's team wants to proceed @ptgott @alexfornuto

@alexfornuto
Copy link
Copy Markdown
Contributor

alexfornuto commented Apr 6, 2023

It looks to me like docs/pages/management/diagnostics/profiles.mdx is the only page that expects the --debug flag in this partial. I tested a solve locally where we can add the extra flag when needed using a partial variable, and if we're all happy with that I can push it to this branch. I made a PR with a potential solve for both tabs.

* add flag var and extra detail for debug

* Update docs/pages/includes/diagnostics/diag-addr-prereqs-tabs.mdx

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
@pschisa pschisa requested a review from rosstimothy April 7, 2023 17:31
Comment thread docs/pages/includes/diagnostics/diag-addr-prereqs-tabs.mdx Outdated
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy left a comment

Choose a reason for hiding this comment

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

🎉

@pschisa pschisa added this pull request to the merge queue Apr 7, 2023
Merged via the queue into master with commit 785fa04 Apr 7, 2023
@pschisa pschisa deleted the pschisa-patch-4 branch April 7, 2023 18:37
@public-teleport-github-review-bot
Copy link
Copy Markdown

@pschisa See the table below for backport results.

Branch Result
branch/v10 Failed
branch/v11 Failed
branch/v12 Create PR

@pschisa
Copy link
Copy Markdown
Contributor Author

pschisa commented Apr 7, 2023

v10 and v11 did not get the debug added so not backport required

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