Hi folks,
Start off saying that my setup was working perfectly when I use elasticsearch as the apm server output.
The problem
I'm using apm version 6.6.0 and I'm trying to configure apm server to use kafka as output. I'm basically trying to follow this post but it did't work for me.
Let's review my config:
apm-server.yml
setup:
kibana:
host: "http://kibana:5601"
dashboards:
enabled: true
...
output.kafka:
hosts: ["kafka:9092"]
topics:
- topic: 'apm-%{[processor.event]}'
partition.round_robin:
reachable_only: false
required_acks: 1
compression: gzip
max_message_bytes: 1000000
logstash
input {
...
kafka {
bootstrap_servers => "kafka:9092"
topics_pattern => "apm.*"
codec => "json"
tags => ["apm"]
type => "log"
client_id => "apm-server"
}
}
output {
if [tags] == "apm" {
elasticsearch {
hosts => ["elasticsearch:9200"]
index => "apm-%{[beat][version]}-%{[processor][event]}-%{+YYYY.MM.dd}"
}
}
else {
elasticsearch {
hosts => ["elasticsearch:9200"]
index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
}
}
}
kibana.yml
Note: I'm using this reference to override indexes found here
server:
name: kibana
host: "0"
elasticsearch:
hosts: http://elasticsearch:9200
apm:
errorIndices: apm-*
spanIndices: apm-*
transactionIndices: apm-*
onboardingIndices: apm-*
After I deploy the stack I run a k8s job to load the templates:
...
containers:
- name: create-apm-template
image: docker.elastic.co/apm/apm-server:6.6.0
command: [ "apm-server", "setup", "--template",
"-E", "output.kafka.enabled=false",
"-E", 'output.elasticsearch.hosts=["elasticsearch.blah:9200"]' ]
- name: force-kibana-new-documents
image: "appropriate/curl"
command: ["curl", "-XDELETE", "elasticsearch.blah:9200/apm-server-*"]
...
I go and check that the template is properly created:
GET _template/apm*
output here
As I have metrics beats enabled for kafka I check that topics are successfully created
Also I see the entries in discovery
I had a similar problem described in this post (kudos for sqren). I'm trying to tail down the problem following the same steps. I can see the same errors in kibana here after loading the list of services, but in this time I can see the index as I loaded it manually as described above.
Any tips what's happing here?
Thanks!
Carlos M.