Skip to content
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

Dynatrace Output Plugin: Fixed behaviour when state map is cleared #8251

Merged
merged 66 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
b5f2608
added dynatrace client install instructions
Jul 2, 2020
d2c3d57
fixed some minor issues
Jul 14, 2020
72dd44e
added idea to gitignore
Jul 14, 2020
f49ac2a
changed to DT normalized metric and dimension keys
wolfgangB33r Jul 14, 2020
62c6054
changed to DT normalized metric and dimension keys
wolfgangB33r Jul 14, 2020
34d5f56
changed escaping of values to strconv.Quote
wolfgangB33r Jul 14, 2020
8091b28
Merge pull request #1 from dynatrace-oss-contrib/include-dt-plugin
thschue Jul 16, 2020
de0b09f
added oneagent support
Jul 20, 2020
9c4f3d7
adapted handling for oneagent
Jul 21, 2020
6ae8014
removed debug output
Jul 21, 2020
3aa5d94
Merge pull request #2 from dynatrace-oss-contrib/add-oneagent
thschue Jul 23, 2020
02f560c
fixed normalization for fields, if they start with a digit
Jul 24, 2020
795e3c5
Merge branch 'master' of github.com:influxdata/telegraf
Jul 27, 2020
fb56fcf
fixed normalization
Jul 30, 2020
0e6a347
changed package name
Jul 30, 2020
fc95083
added readme information about direct OneAgent ingest endpoint
Aug 7, 2020
5087a01
added a metric name prefix setting
wolfgangB33r Aug 7, 2020
c4284f7
Merge branch 'master' of github.com:influxdata/telegraf
Aug 10, 2020
9e7dccf
fmtted file
Aug 10, 2020
91e26d9
changed doc
Aug 11, 2020
b783f3a
Update plugins/outputs/dynatrace/dynatrace.go
thschue Aug 12, 2020
38a05fd
Apply suggestions from code review
thschue Aug 12, 2020
a273e62
added requested changes
Aug 12, 2020
de2728f
changed log output
Aug 12, 2020
72b0bc0
changed tls configuration
Aug 12, 2020
f75f254
adapted tests
Aug 12, 2020
72c2418
fmtted file
Aug 12, 2020
869cda4
fixed tests
Aug 12, 2020
9f16099
fixed tag order and added encoding checks in all tests
wolfgangB33r Aug 12, 2020
2167b54
changed formatting
wolfgangB33r Aug 12, 2020
09a8523
Update README.md
mikopp Aug 17, 2020
34fb52f
Merge branch 'master' of github.com:influxdata/telegraf
Aug 17, 2020
c7b1071
Merge pull request #3 from mikopp/patch-2
thschue Aug 17, 2020
fb6c59a
Update README.md
mikopp Aug 17, 2020
1f9fe16
Update README.md
mikopp Aug 17, 2020
42afe19
Update README.md
thschue Aug 17, 2020
c213477
Update README.md
thschue Aug 17, 2020
ca3297f
Update README.md
thschue Aug 17, 2020
74a9148
Merge pull request #4 from mikopp/patch-3
thschue Aug 17, 2020
43dafea
Update README.md
thschue Aug 17, 2020
6edda7e
Update README.md
thschue Aug 17, 2020
0faf5c4
Update README.md
thschue Aug 17, 2020
bf35e34
Update README.md
thschue Aug 17, 2020
231878a
Update README.md
mikopp Aug 17, 2020
0687eaf
Merge pull request #5 from mikopp/patch-4
thschue Aug 17, 2020
ceb4221
Update README.md
thschue Aug 17, 2020
eeb6bed
removed InsecureSkipVerify from struct as it is part of github.com/in…
Aug 20, 2020
4ae0062
Merge branch 'master' of github.com:influxdata/telegraf
Aug 20, 2020
99b3905
Small Doc change
Aug 20, 2020
43b35f2
go fmtted file
Aug 20, 2020
6fdc281
Added dash to AllowedCharList
Sep 7, 2020
1067ad9
Changed Handling of Monotonic Counters
Sep 21, 2020
d30a3b0
Merge branch 'master' of github.com:influxdata/telegraf
Sep 21, 2020
f6b3fb3
Update plugins/outputs/dynatrace/README.md
thschue Sep 21, 2020
a105de5
added delta value support for monotonic count metric types
wolfgangB33r Sep 24, 2020
30f6cac
deleted out.txt file
wolfgangB33r Sep 24, 2020
65fb0af
Merge branch 'master' of github.com:influxdata/telegraf
Sep 24, 2020
90a71f7
added a global state flush interval to prevent any long running memor…
wolfgangB33r Sep 25, 2020
5264a36
Merge branch 'master' of github.com:influxdata/telegraf
Sep 28, 2020
8964e3c
Fix delta reset (#6)
thschue Oct 9, 2020
d51b77b
fixed merge conflicts
Oct 9, 2020
6b00413
removed blank line
Oct 9, 2020
18a60d3
go fmtted file
Oct 9, 2020
3b923ab
Merge branch 'master' of github.com:influxdata/telegraf
Oct 12, 2020
d82a244
Merge branch 'master' of github.com:influxdata/telegraf
Oct 14, 2020
06f0259
fixed broken link
Oct 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/outputs/dynatrace/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dynatrace Output Plugin

This plugin is sending telegraf metrics to [Dynatrace](www.dynatrace.com). It has two operational modes.
This plugin is sending telegraf metrics to [Dynatrace](https://www.dynatrace.com). It has two operational modes.

Telegraf minimum version: Telegraf 1.16
Plugin minimum tested version: 1.16
Expand Down
24 changes: 17 additions & 7 deletions plugins/outputs/dynatrace/dynatrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,26 @@ func (d *Dynatrace) Write(metrics []telegraf.Metric) error {
// write metric id,tags and value
switch metric.Type() {
case telegraf.Counter:
var delta float64 = 0

// Check if LastValue exists
if lastvalue, ok := counts[metricID+tagb.String()]; ok {
// only send a counter if a lastvalue is found in the map
// if last value is found we can calc and send the delta value
if v, err := strconv.ParseFloat(lastvalue, 32); err == nil {
if v2, err := strconv.ParseFloat(value, 32); err == nil {
fmt.Fprintf(&buf, "%s%s count,delta=%f\n", metricID, tagb.String(), v2-v)
}
// Convert Strings to Floats
floatLastValue, err := strconv.ParseFloat(lastvalue, 32)
if err != nil {
d.Log.Debugf("Could not parse last value: %s", lastvalue)
ssoroka marked this conversation as resolved.
Show resolved Hide resolved
}
floatCurrentValue, err := strconv.ParseFloat(value, 32)
if err != nil {
d.Log.Debugf("Could not parse current value: %s", value)
ssoroka marked this conversation as resolved.
Show resolved Hide resolved
}
if floatCurrentValue > floatLastValue {
ssoroka marked this conversation as resolved.
Show resolved Hide resolved
delta = floatCurrentValue - floatLastValue
fmt.Fprintf(&buf, "%s%s count,delta=%f\n", metricID, tagb.String(), delta)
}
}
// put the current value into the map as last value
counts[metricID+tagb.String()] = value

default:
fmt.Fprintf(&buf, "%s%s %v\n", metricID, tagb.String(), value)
}
Expand All @@ -214,6 +223,7 @@ func (d *Dynatrace) Write(metrics []telegraf.Metric) error {
}
sent++
// in typical interval of 10s, we will clean the counter state once in 24h which is 8640 iterations

if sent%8640 == 0 {
counts = make(map[string]string)
}
Expand Down