Skip to content

Commit

Permalink
use the apmStats directly in the gui UI
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoCaso committed Nov 23, 2023
1 parent d3f2b29 commit da6b054
Showing 1 changed file with 56 additions and 3 deletions.
59 changes: 56 additions & 3 deletions cmd/agent/gui/views/templates/generalStatus.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,61 @@
</span>
</div>

<div class="stat" id="apmStats">
<div class="stat">
<span class="stat_title">APM</span>
<span class="stat_data">Loading...</span>
<span class="stat_data">
{{- with .apmStats -}}
{{- if .error }}
Not running or unreachable on localhost:{{.port}}<br>
Error: {{.error}}<br>
{{- else}}
Status: Running<br>
Pid: {{.pid}}<br>
Uptime: {{.uptime}} seconds<br>
Mem alloc: {{humanize .memstats.Alloc}} bytes<br>
Hostname: {{.config.Hostname}}<br>
Receiver: {{.config.ReceiverHost}}:{{.config.ReceiverPort}}<br>
Endpoints:
<span class="stat_subdata">
{{- range $i, $e := .config.Endpoints}}
{{ $e.Host }}<br />
{{- end }}
</span>
<span class="stat_subtitle">Receiver (previous minute)</span>
<span class="stat_subdata">
{{- if eq (len .receiver) 0}}
No traces received in the previous minute.<br>
{{ else }}
{{ range $i, $ts := .receiver }}
From {{if $ts.Lang}}{{ $ts.Lang }} {{ $ts.LangVersion }} ({{ $ts.Interpreter }}), client {{ $ts.TracerVersion }}{{else}}unknown clients{{end}}
<span class="stat_subdata">
Traces received: {{ $ts.TracesReceived }} ({{ humanize $ts.TracesBytes }} bytes)<br>
Spans received: {{ $ts.SpansReceived }}
{{ with $ts.WarnString }}
<br>WARNING: {{ . }}</br>
{{ end }}
</span>
{{ end }}
{{ end }}

{{range $key, $value := .ratebyservice_filtered -}}
{{- if eq $key "service:,env:" -}}
Default priority sampling rate: {{percent $value}}%
{{- else}}
Priority sampling rate for '{{ $key }}': {{percent $value}}%
{{- end}}
{{- end }}
</span>
<span class="stat_subtitle">Writer (previous minute)</span>
<span class="stat_subdata">
Traces: {{.trace_writer.Payloads}} payloads, {{.trace_writer.Traces}} traces, {{.trace_writer.Events}} events, {{humanize .trace_writer.Bytes}} bytes<br>
{{- if gt .trace_writer.Errors 0.0}}WARNING: Traces API errors (1 min): {{.trace_writer.Errors}}{{end}}
Stats: {{.stats_writer.Payloads}} payloads, {{.stats_writer.StatsBuckets}} stats buckets, {{humanize .stats_writer.Bytes}} bytes<br>
{{- if gt .stats_writer.Errors 0.0}}WARNING: Stats API errors (1 min): {{.stats_writer.Errors}}{{end}}
</span>
{{- end }}
{{ end }}
</span>
</div>

<div class="stat">
Expand Down Expand Up @@ -533,7 +585,8 @@
{{- end }}
{{ end }}
</span>
</div>
</div>



<div class="stat">
Expand Down

0 comments on commit da6b054

Please sign in to comment.