Skip to content

Commit

Permalink
make sure templates preserve the same amount of white space
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoCaso committed Nov 22, 2023
1 parent 6c8847a commit 05d8059
Show file tree
Hide file tree
Showing 13 changed files with 402 additions and 412 deletions.
100 changes: 50 additions & 50 deletions pkg/status/render/templates/aggregator.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,54 @@ NOTE: Changes made to this template should be reflected on the following templat
Aggregator
==========
{{- with .aggregatorStats }}
{{- if .ChecksMetricSample }}
Checks Metric Sample: {{humanize .ChecksMetricSample}}
{{- end }}
{{- if .DogstatsdMetricSample}}
Dogstatsd Metric Sample: {{humanize .DogstatsdMetricSample}}
{{- end }}
{{- if .Event}}
Event: {{humanize .Event}}
{{- end }}
{{- if .EventsFlushed}}
Events Flushed: {{humanize .EventsFlushed}}
{{- end }}
{{- if .EventsFlushErrors}}
Events Flush Errors: {{humanize .EventsFlushErrors}}
{{- end }}
{{- if .NumberOfFlush}}
Number Of Flushes: {{humanize .NumberOfFlush}}
{{- end }}
{{- if .SeriesFlushed}}
Series Flushed: {{humanize .SeriesFlushed}}
{{- end }}
{{- if .SeriesFlushErrors}}
Series Flush Errors: {{humanize .SeriesFlushErrors}}
{{- end }}
{{- if .ServiceCheck}}
Service Check: {{humanize .ServiceCheck}}
{{- end }}
{{- if .ServiceCheckFlushed}}
Service Checks Flushed: {{humanize .ServiceCheckFlushed}}
{{- end }}
{{- if .ServiceCheckFlushErrors}}
Service Checks Flush Errors: {{humanize .ServiceCheckFlushErrors}}
{{- end }}
{{- if .SketchesFlushed}}
Sketches Flushed: {{humanize .SketchesFlushed}}
{{- end }}
{{- if .SketchesFlushErrors}}
Sketches Flush Errors: {{humanize .SketchesFlushErrors}}
{{- end }}
{{- if .ChecksHistogramBucketMetricSample }}
Checks Histogram Bucket Metric Sample: {{humanize .ChecksHistogramBucketMetricSample}}
{{- end }}
{{- if .EventPlatformEvents }}
{{- range $k, $v := .EventPlatformEvents }}
{{ $k }}: {{humanize $v}}
{{- end }}
{{- end }}
{{- if .HostnameUpdate}}
Hostname Update: {{humanize .HostnameUpdate}}
{{- end }}
{{- if .ChecksMetricSample }}
Checks Metric Sample: {{humanize .ChecksMetricSample}}
{{- end }}
{{- if .DogstatsdMetricSample}}
Dogstatsd Metric Sample: {{humanize .DogstatsdMetricSample}}
{{- end }}
{{- if .Event}}
Event: {{humanize .Event}}
{{- end }}
{{- if .EventsFlushed}}
Events Flushed: {{humanize .EventsFlushed}}
{{- end }}
{{- if .EventsFlushErrors}}
Events Flush Errors: {{humanize .EventsFlushErrors}}
{{- end }}
{{- if .NumberOfFlush}}
Number Of Flushes: {{humanize .NumberOfFlush}}
{{- end }}
{{- if .SeriesFlushed}}
Series Flushed: {{humanize .SeriesFlushed}}
{{- end }}
{{- if .SeriesFlushErrors}}
Series Flush Errors: {{humanize .SeriesFlushErrors}}
{{- end }}
{{- if .ServiceCheck}}
Service Check: {{humanize .ServiceCheck}}
{{- end }}
{{- if .ServiceCheckFlushed}}
Service Checks Flushed: {{humanize .ServiceCheckFlushed}}
{{- end }}
{{- if .ServiceCheckFlushErrors}}
Service Checks Flush Errors: {{humanize .ServiceCheckFlushErrors}}
{{- end }}
{{- if .SketchesFlushed}}
Sketches Flushed: {{humanize .SketchesFlushed}}
{{- end }}
{{- if .SketchesFlushErrors}}
Sketches Flush Errors: {{humanize .SketchesFlushErrors}}
{{- end }}
{{- if .ChecksHistogramBucketMetricSample }}
Checks Histogram Bucket Metric Sample: {{humanize .ChecksHistogramBucketMetricSample}}
{{- end }}
{{- if .EventPlatformEvents }}
{{- range $k, $v := .EventPlatformEvents }}
{{ $k }}: {{humanize $v}}
{{- end }}
{{- end }}
{{- if .HostnameUpdate}}
Hostname Update: {{humanize .HostnameUpdate}}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion pkg/status/render/templates/autodiscovery.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ NOTE: Changes made to this template should be reflected on the following templat
=============
Autodiscovery
=============
{{- with .adEnabledFeatures}}
{{- with .adEnabledFeatures -}}
Enabled Features
================
{{- range $feature, $empty := . }}
Expand Down
3 changes: 1 addition & 2 deletions pkg/status/render/templates/clusteragent.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{{- with .clusterAgentStatus -}}
=====================
Datadog Cluster Agent
Expand All @@ -17,4 +16,4 @@ Datadog Cluster Agent
Successfully connected to the Datadog Cluster Agent.
- Running: {{ .Version }}
{{- end }}
{{- end}}
{{- end -}}
6 changes: 3 additions & 3 deletions pkg/status/render/templates/dogstatsd.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ NOTE: Changes made to this template should be reflected on the following templat
DogStatsD
=========
{{- with .dogstatsdStats -}}
{{- range $key, $value := .}}
{{formatTitle $key}}: {{humanize $value}}
{{- end }}
{{- range $key, $value := .}}
{{formatTitle $key}}: {{humanize $value}}
{{- end }}
{{- end }}

Tip: For troubleshooting, enable 'dogstatsd_metrics_stats_enable' in the main datadog.yaml file to generate Dogstatsd logs. Once 'dogstatsd_metrics_stats_enable' is enabled, users can also use 'dogstatsd-stats' command to get visibility of the latest collected metrics.
13 changes: 5 additions & 8 deletions pkg/status/render/templates/endpoints.tmpl
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{{/*
NOTE: Changes made to this template should be reflected on the following templates, if applicable:
* cmd/agent/gui/views/templates/generalStatus.tmpl
*/}}

==========
*/}}==========
Endpoints
==========

{{- with .endpointsInfos}}
{{- range $key, $value := .}}
{{- with .endpointsInfos -}}
{{ range $key, $value := .}}
{{$key}} - API Key{{ if gt (len $value) 1}}s{{end}} ending with:
{{- range $idx, $apikey := $value }}
- {{$apikey}}
{{- end}}
{{- end}}
{{- else }}

No endpoints information. The agent may be misconfigured.
{{- end }}
No endpoints information. The agent may be misconfigured.
{{end }}

142 changes: 70 additions & 72 deletions pkg/status/render/templates/forwarder.tmpl
Original file line number Diff line number Diff line change
@@ -1,95 +1,93 @@
{{/*
NOTE: Changes made to this template should be reflected on the following templates, if applicable:
* cmd/agent/gui/views/templates/generalStatus.tmpl
*/}}

=========
*/}}=========
Forwarder
=========
{{- with .forwarderStats -}}
{{ if .Transactions }}
Transactions
============
{{- range $key, $value := .Transactions }}
{{- if and (ne $key "InputBytesByEndpoint") (ne $key "InputCountByEndpoint") (ne $key "DroppedByEndpoint") (ne $key "RequeuedByEndpoint") (ne $key "RetriedByEndpoint") (ne $key "Success") (ne $key "SuccessByEndpoint") (ne $key "SuccessBytesByEndpoint") (ne $key "Errors") (ne $key "ErrorsByType") (ne $key "HTTPErrors") (ne $key "HTTPErrorsByCode") (ne $key "ConnectionEvents")}}
{{$key}}: {{humanize $value}}
{{- end}}
{{with .forwarderStats -}}
{{ if .Transactions }}
Transactions
============
{{- range $key, $value := .Transactions }}
{{- if and (ne $key "InputBytesByEndpoint") (ne $key "InputCountByEndpoint") (ne $key "DroppedByEndpoint") (ne $key "RequeuedByEndpoint") (ne $key "RetriedByEndpoint") (ne $key "Success") (ne $key "SuccessByEndpoint") (ne $key "SuccessBytesByEndpoint") (ne $key "Errors") (ne $key "ErrorsByType") (ne $key "HTTPErrors") (ne $key "HTTPErrorsByCode") (ne $key "ConnectionEvents")}}
{{$key}}: {{humanize $value}}
{{- end}}
{{- if .Transactions.DroppedOnInput }}
{{- end}}
{{- if .Transactions.DroppedOnInput }}

Warning: the forwarder dropped transactions, there is probably an issue with your network
More info at https://github.com/DataDog/datadog-agent/tree/main/docs/agent/status.md
{{- end}}
{{- if .Transactions.Success}}
Warning: the forwarder dropped transactions, there is probably an issue with your network
More info at https://github.com/DataDog/datadog-agent/tree/main/docs/agent/status.md
{{- end}}
{{- if .Transactions.Success}}

Transaction Successes
=====================
Total number: {{.Transactions.Success}}
Successes By Endpoint:
{{- range $type, $count := .Transactions.SuccessByEndpoint }}
{{- if $count }}
{{$type}}: {{humanize $count}}
{{- end}}
Transaction Successes
=====================
Total number: {{.Transactions.Success}}
Successes By Endpoint:
{{- range $type, $count := .Transactions.SuccessByEndpoint }}
{{- if $count }}
{{$type}}: {{humanize $count}}
{{- end}}
{{- end}}
{{- if .Transactions.Errors }}
{{- end}}
{{- end}}
{{- if .Transactions.Errors }}

Transaction Errors
==================
Total number: {{.Transactions.Errors}}
Errors By Type:
{{- range $type, $count := .Transactions.ErrorsByType }}
{{- if $count }}
{{$type}}: {{humanize $count}}
{{- end}}
Transaction Errors
==================
Total number: {{.Transactions.Errors}}
Errors By Type:
{{- range $type, $count := .Transactions.ErrorsByType }}
{{- if $count }}
{{$type}}: {{humanize $count}}
{{- end}}
{{- end}}
{{- if .Transactions.HTTPErrors }}

HTTP Errors
==================
Total number: {{.Transactions.HTTPErrors}}
HTTP Errors By Code:
{{- range $code, $count := .Transactions.HTTPErrorsByCode }}
{{- if $count}}
{{$code}}: {{humanize $count}}
{{- end}}
{{- end}}
{{- end}}
{{- end}}
{{- if .Transactions.HTTPErrors }}

On-disk storage
===============
{{- if .forwarder_storage_max_size_in_bytes }}
{{- if .FileStorage.CurrentSizeInBytes }}
Disk usage in bytes: {{ .FileStorage.CurrentSizeInBytes }}
Current number of files: {{ .FileStorage.FilesCount }}
Number of files dropped: {{ .FileStorage.FilesRemovedCount }}
Deserialization errors count: {{ .FileStorage.DeserializeErrorsCount }}
Outdated files removed at startup: {{ .RemovalPolicy.OutdatedFilesCount }}
{{- else }}
Enabled, not in-use.
HTTP Errors
==================
Total number: {{.Transactions.HTTPErrors}}
HTTP Errors By Code:
{{- range $code, $count := .Transactions.HTTPErrorsByCode }}
{{- if $count}}
{{$code}}: {{humanize $count}}
{{- end}}
{{- end}}
{{- end}}
{{- end}}

On-disk storage
===============
{{- if .forwarder_storage_max_size_in_bytes }}
{{- if .FileStorage.CurrentSizeInBytes }}
Disk usage in bytes: {{ .FileStorage.CurrentSizeInBytes }}
Current number of files: {{ .FileStorage.FilesCount }}
Number of files dropped: {{ .FileStorage.FilesRemovedCount }}
Deserialization errors count: {{ .FileStorage.DeserializeErrorsCount }}
Outdated files removed at startup: {{ .RemovalPolicy.OutdatedFilesCount }}
{{- else }}
On-disk storage is disabled. Configure `forwarder_storage_max_size_in_bytes` to enable it.
Enabled, not in-use.
{{- end}}
{{- else }}
On-disk storage is disabled. Configure `forwarder_storage_max_size_in_bytes` to enable it.
{{- end}}

{{- if .APIKeyStatus }}
{{- if .APIKeyStatus }}

API Keys status
===============
{{- range $key, $value := .APIKeyStatus }}
{{$key}}: {{$value}}
{{- end }}
{{- end}}
API Keys status
===============
{{- range $key, $value := .APIKeyStatus }}
{{$key}}: {{$value}}
{{- end }}
{{- end}}

{{- if .APIKeyFailure }}
{{- if .APIKeyFailure }}

API Keys errors
===============
{{- range $key, $value := .APIKeyFailure }}
{{yellowText $key}}{{yellowText ":"}} {{yellowText $value}}
{{- end }}
{{- end}}
API Keys errors
===============
{{- range $key, $value := .APIKeyFailure }}
{{yellowText $key}}{{yellowText ":"}} {{yellowText $value}}
{{- end }}
{{- end}}
{{- end}}

Loading

0 comments on commit 05d8059

Please sign in to comment.