sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
204 stars 79 forks source link

Homer and Telegraf #406

Closed DGEllis closed 3 years ago

DGEllis commented 3 years ago

Looking through /usr/local/homer/etc/web_app_config.json I noted the option to connect to influxdb. I'm familiar with the TICK stack and Grafana, I added the configuration for my influxdb server, v1.83.

I made a few test calls and found no data in influxdb. After an email from sipcapture, I learned that telegraf actually feeds the data to influxdb. So, I checked for a homer/heplify section in telegraf.conf. I didn't find anything.

I attempted to bring up the docker version, but I wasn't able to do so. BUT! I did find a telegraf configuration. Unfortunately, I've never used telegraf in this way and can't seem to figure it out. Also, I have not been able to find instructions on how to set this up.

I know that in homer-app, the influxdb configuration is used to query the information that telegraf writes to influxdb. What I'm stuck on is how to configure telegraf.

How do I enable metrics in homer-app and/or heplify-server and query them?

Is there any documentation on these features? I'd love to get this working.

Does anyone have this working, not in Docker, who can assist?

My system is a CentOS 8 VM running on Hyper-V. Postgresql is on it's own dedicated ESXi VM.

Why are the sections in the example telegraf configuration file duplicated?

Thanks much!

Darren


This is my slightly modified /etc/telegraf/telegraf.d/homer7.conf file:

[[outputs.influxdb]] urls = ["http://172.24.1.47:8086/"] # required database = "telegraf" # required retention_policy = "autogen" write_consistency = "any" timeout = "5s" namedrop = ["hep*"]

[[outputs.influxdb]] urls = ["http://172.24.1.47:8086/"] # required database = "homer" # required retention_policy = "" write_consistency = "any" timeout = "5s" namepass = ["hep*"]

Generic socket listener capable of handling multiple socket types.

[[inputs.socket_listener]] service_address = "udp://127.0.0.1:8094" data_format = "influx"

[[inputs.socket_listener]] service_address = "tcp://127.0.0.1:8094" data_format = "influx"

[[inputs.prometheus]]

An array of urls to scrape metrics from.

[[outputs.influxdb]] urls = ["http://172.24.1.47:8086/"] # required database = "telegraf" # required retention_policy = "autogen" write_consistency = "any" timeout = "5s" namedrop = ["hep*"]

[[outputs.influxdb]] urls = ["http://172.24.1.47:8086/"] # required database = "homer" # required retention_policy = "" write_consistency = "any" timeout = "5s" namepass = ["hep*"]

Generic socket listener capable of handling multiple socket types.

[[inputs.socket_listener]] service_address = "udp://127.0.0.1:8094" data_format = "influx"

[[inputs.socket_listener]] service_address = "tcp://127.0.0.1:8094" data_format = "influx"

[[inputs.prometheus]]

An array of urls to scrape metrics from.

urls = ["http://localhost:9066/metrics"] namedrop = ["go","process","promhttp*"]

[[inputs.statsd]] protocol = "udp" max_tcp_connections = 250 tcp_keep_alive = false

tcp_keep_alive_period = "2h"

service_address = ":8125" delete_gauges = true delete_counters = true delete_sets = true delete_timings = true

Percentiles to calculate for timing & histogram stats.

percentiles = [50.0, 90.0, 99.0, 99.9, 99.95, 100.0] metricseparator = "" parse_data_dog_tags = true datadog_extensions = true allowed_pending_messages = 10000 percentile_limit = 1000

read_buffer_size = 65535urls = ["http://localhost:9066/metrics"]

namedrop = ["go","process","promhttp*"]

[[inputs.statsd]] protocol = "udp" max_tcp_connections = 250 tcp_keep_alive = false

tcp_keep_alive_period = "2h"

service_address = ":8125" delete_gauges = true delete_counters = true delete_sets = true delete_timings = true

Percentiles to calculate for timing & histogram stats.

percentiles = [50.0, 90.0, 99.0, 99.9, 99.95, 100.0] metricseparator = "" parse_data_dog_tags = true datadog_extensions = true allowed_pending_messages = 10000 percentile_limit = 1000

read_buffer_size = 65535

lmangani commented 3 years ago

Hi @DGEllis

The pipeline is heplify-server -> prom <- telegraf -> influxdb so all you need is the following in telegraf:

[[outputs.influxdb]]
urls = ["http://influxdb_ip:8086/"] # required
database = "homer" # required
retention_policy = ""
write_consistency = "any"
timeout = "5s"
namepass = ["hep*"]

[[inputs.prometheus]]
urls = ["http://homer_ip:9066/metrics"]
namedrop = ["go*","process*","promhttp*"]

Just replace the influxdb_ip and homer_ip and it should just work out of the box. If telegraf runs on the same box as hepflify-server, the latter should be just localhost. Let me know if you have any issues with the above.

DGEllis commented 3 years ago

Thank you for the quick response. What listens on 9066? homer-app or heplify-server? Can you show me the relevant configuration?

Thank you,

Darren

aqsyonas commented 3 years ago

Hi

You need to configure port 9066 in heplify-server.

https://github.com/sipcapture/heplify-server/blob/master/example/homer7_config/heplify-server.toml#L13 PromAddr = "0.0.0.0:9066"

But if you have done the homer installation using installer, it should have configured all this for you.

Br, Aqs

On Thu, Dec 3, 2020 at 4:39 AM DGEllis notifications@github.com wrote:

Thank you for the quick response. What listens on 9066? homer-app or heplify-server? Can you show me the relevant configuration?

Thank you,

Darren

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sipcapture/homer-app/issues/406#issuecomment-737561687, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL42CJJF4JWYWJFJOHD2YA3SS3F4DANCNFSM4ULCHBMA .