Skip to content

Commit 25c564a

Browse files
committed
[Heartbeat] Use service.name not service_name in configs (elastic#20330)
Using the nesting this way lets us handle future fields like service.environment more cleanly if/when they become available. See https://github.com/elastic/ecs/blob/master/rfcs/text/0002-rfc-environment.md for the proposal to add service.environment This is a follow-up to elastic#19932 which has not yet been released, so this is not a breaking change. (cherry picked from commit 425271b)
1 parent d9116c8 commit 25c564a

18 files changed

+105
-26
lines changed

CHANGELOG.next.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
7272

7373
*Heartbeat*
7474

75-
7675
*Journalbeat*
7776

7877
- Improve parsing of syslog.pid in journalbeat to strip the username when present {pull}16116[16116]
@@ -242,6 +241,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
242241

243242
*Heartbeat*
244243

244+
- The `service_name` monitor option is being replaced with `service.name` which is more correct. We will support the old option till 8.0. {pull}20330[20330]
245245

246246
*Journalbeat*
247247

heartbeat/_meta/config/beat.reference.yml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ heartbeat.monitors:
3232
name: my-icmp-monitor
3333

3434
# Name of corresponding APM service, if Elastic APM is in use for the monitored service.
35-
# service_name: my-apm-service-name
35+
# service.name: my-apm-service-name
3636

3737
# Enable/Disable monitor
3838
#enabled: true

heartbeat/_meta/config/beat.yml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ heartbeat.monitors:
3333
# Total test connection and data exchange timeout
3434
#timeout: 16s
3535
# Name of corresponding APM service, if Elastic APM is in use for the monitored service.
36-
#service_name: my-apm-service-name
36+
#service.name: my-apm-service-name
3737

3838
{{header "Elasticsearch template setting"}}
3939

heartbeat/beater/heartbeat.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func New(b *beat.Beat, rawConfig *common.Config) (beat.Beater, error) {
5454
if err := rawConfig.Unpack(&parsedConfig); err != nil {
5555
return nil, fmt.Errorf("Error reading config file: %v", err)
5656
}
57-
5857
limit := parsedConfig.Scheduler.Limit
5958
locationName := parsedConfig.Scheduler.Location
6059
if locationName == "" {

heartbeat/docs/getting-started.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ heartbeat.monitors:
8181
- type: http
8282
schedule: '@every 5s'
8383
urls: ["http://example.net"]
84-
service_name: apm-service-name <4>
84+
service.name: apm-service-name <4>
8585
id: my-http-service
8686
name: My HTTP Service
8787
----------------------------------------------------------------------
@@ -92,7 +92,7 @@ https://github.com/gorhill/cronexpr#implementation[this `cronexpr` implementatio
9292
was started. Heartbeat adds the `@every` keyword to the syntax provided by the
9393
`cronexpr` package.
9494
<3> The `mode` specifies whether to ping one IP (`any`) or all resolvable IPs
95-
<4> The `service_name` field can be used to integrate heartbeat with elastic APM via the Uptime UI.
95+
<4> The `service.name` field can be used to integrate heartbeat with elastic APM via the Uptime UI.
9696

9797
include::{libbeat-dir}/shared/config-check.asciidoc[]
9898

heartbeat/docs/heartbeat-options.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ heartbeat.monitors:
3838
- type: http
3939
id: service-status
4040
name: Service Status
41-
service_name: my-apm-service-name
41+
service.name: my-apm-service-name
4242
hosts: ["http://localhost:80/service/status"]
4343
check.response.status: [200]
4444
schedule: '@every 5s'

heartbeat/docs/monitors/monitor-common-options.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ as `monitor.name`.
3535

3636
[float]
3737
[[service-name]]
38-
==== `service_name`
38+
==== `service.name`
3939

4040
Optional APM service name for this monitor. Corresponds to the `service.name` ECS field. Set this when monitoring an app
4141
that is also using APM to enable integrations between Uptime and APM data in Kibana.

heartbeat/heartbeat.reference.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ heartbeat.monitors:
3232
name: my-icmp-monitor
3333

3434
# Name of corresponding APM service, if Elastic APM is in use for the monitored service.
35-
# service_name: my-apm-service-name
35+
# service.name: my-apm-service-name
3636

3737
# Enable/Disable monitor
3838
#enabled: true

heartbeat/heartbeat.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ heartbeat.monitors:
3333
# Total test connection and data exchange timeout
3434
#timeout: 16s
3535
# Name of corresponding APM service, if Elastic APM is in use for the monitored service.
36-
#service_name: my-apm-service-name
36+
#service.name: my-apm-service-name
3737

3838
# ======================= Elasticsearch template setting =======================
3939

heartbeat/monitors.d/sample.http.yml.disabled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
name: My HTTP Monitor
1212

1313
# Name of corresponding APM service, if Elastic APM is in use for the monitored service.
14-
#service_name: my-apm-service-name
14+
#service.name: my-apm-service-name
1515

1616
# Enable/Disable monitor
1717
#enabled: true

0 commit comments

Comments
 (0)