# Service names are split by -, which isn't documented

**URL:** <https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317>\
**Category:** APM\
**Created:** [January 23, 2019, 12:09am UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317 "2019-01-23T00:09:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![krainboltgreene](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krainboltgreene/32/37174_2.png) [@krainboltgreene](https://discuss.elastic.co/u/krainboltgreene)\
**Post date:** [January 23, 2019, 12:09am UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/1 "2019-01-23T00:09:00Z")

</div>

I have a service called `second-reef-api`, and amusingly this showed up:

![04%20PM](https://us1.discourse-cdn.com/elastic/original/3X/0/f/0fe1f30509f4fb422834f3a063141b9af39e15ca.png)

Is there a way to correct this post-hoc or do I have to rename my service to SecondReefAPI?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [January 23, 2019, 1:02am UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/2 "2019-01-23T01:02:29Z")

</div>

Hi Kurtis,

Can you please provide some more information on your application, and Elastic Stack setup? Which agent? Which stack version? We use various testing services which have hyphenated names which do not exhibit this behaviour.

---

<div class="post-metadata">

**Author:** ![stephenbelanger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenbelanger/32/34880_2.png) [@stephenbelanger](https://discuss.elastic.co/u/stephenbelanger)\
**Post date:** [January 23, 2019, 1:03am UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/3 "2019-01-23T01:03:46Z")

</div>

Can you tell me which language agent you are using and which version of that agent, apm-server, elasticsearch and kibana?

---

<div class="post-metadata">

**Author:** ![krainboltgreene](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krainboltgreene/32/37174_2.png) [@krainboltgreene](https://discuss.elastic.co/u/krainboltgreene)\
**Post date:** [January 23, 2019, 5:30pm UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/4 "2019-01-23T17:30:33Z")

</div>

```auto
# docker-compose.yml
  apm-server:
    image: docker.elastic.co/apm/apm-server:6.5.2
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.2
  logstash:
    image: docker.elastic.co/logstash/logstash:6.5.2
  kibana:
    image: docker.elastic.co/kibana/kibana:6.5.2

```

```ruby
# Gemfile
gem "elastic-apm", "2.1.2"

```

```auto
# config/elastic_apm.yml
# Set service name - allowed characters: a-z, A-Z, 0-9, -, _ and space
# Defaults to the name of your Rails app
service_name: "second-reef-api"

# Set custom APM Server URL (default: http://localhost:8200)
server_url: 'https://apm.ie'

```

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [January 24, 2019, 2:31pm UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/5 "2019-01-24T14:31:08Z")

</div>

I tried to reproduce this using a simple rails app and configuring the same service name, but the service showed up just fine.

Your docker-compose file indicates that `logstash` is involved in the process somehow. Did you change any of the default settings for the server and if so, could you please share what you've changed.

---

<div class="post-metadata">

**Author:** ![sqren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sqren/32/26110_2.png) [@sqren](https://discuss.elastic.co/u/sqren)\
**Post date:** [January 24, 2019, 2:32pm UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/6 "2019-01-24T14:32:28Z")

</div>

Hi Kurtis

Can you try running this query in Kibana Dev Tools:

```auto
GET apm*/_search
{
  "size": 0, 
  "aggs": {
    "serviceName": {
      "terms": {
        "field": "context.service.name",
        "size": 10
      }
    }
  }
}

```

That'll help us diagnose if the names are already split when indexed in Elasticsearch, or if this happens afterwards.

Thank you.

---

<div class="post-metadata">

**Author:** ![krainboltgreene](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krainboltgreene/32/37174_2.png) [@krainboltgreene](https://discuss.elastic.co/u/krainboltgreene)\
**Post date:** [January 24, 2019, 10:40pm UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/7 "2019-01-24T22:40:30Z")

</div>

```json
{
  "took" : 359,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 45949,
    "max_score" : 0.0,
    "hits" : []
  },
  "aggregations" : {
    "serviceName" : {
      "doc_count_error_upper_bound" : 0,
      "sum_other_doc_count" : 0,
      "buckets" : [
        {
          "key" : "api",
          "doc_count" : 44614
        },
        {
          "key" : "reef",
          "doc_count" : 44614
        },
        {
          "key" : "second",
          "doc_count" : 44614
        },
        {
          "key" : "sr",
          "doc_count" : 1333
        },
        {
          "key" : "bouncer",
          "doc_count" : 1099
        },
        {
          "key" : "authentication",
          "doc_count" : 222
        },
        {
          "key" : "warehousing",
          "doc_count" : 12
        }
      ]
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![krainboltgreene](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krainboltgreene/32/37174_2.png) [@krainboltgreene](https://discuss.elastic.co/u/krainboltgreene)\
**Post date:** [January 24, 2019, 10:42pm UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/8 "2019-01-24T22:42:35Z")

</div>

No, my logstash is very simplistic.

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [January 25, 2019, 2:55am UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/9 "2019-01-25T02:55:23Z")

</div>

> No, my logstash is very simplistic.

Even so, if you could provide your apm-server.yml and logstash config, that might help us identify the issue. None of us have been able to reproduce the issue. It's probably something subtle.

---

<div class="post-metadata">

**Author:** ![krainboltgreene](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krainboltgreene/32/37174_2.png) [@krainboltgreene](https://discuss.elastic.co/u/krainboltgreene)\
**Post date:** [January 29, 2019, 1:02am UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/10 "2019-01-29T01:02:22Z")

</div>

Alright, I've done my best to gather all the configurations of my monitoring server: [https://gist.github.com/krainboltgreene/cd7afac60a84c92e2eeaee0ba588a11d](https://gist.github.com/krainboltgreene/cd7afac60a84c92e2eeaee0ba588a11d)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 18, 2019, 9:14pm UTC](https://discuss.elastic.co/t/service-names-are-split-by-which-isnt-documented/165317/11 "2019-02-18T21:14:08Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
