diff --git a/.gitignore b/.gitignore index 3d4558c..22405f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ go.sum solace_exporter -solace_exporter.exe +solace_prometheus_exporter +*.exe .vscode \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 1ec2f28..167809c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,12 +14,12 @@ RUN go get -d -v ./... \ && go build \ -a \ -ldflags '-s -w -extldflags "-static"' \ - -o /bin/solace_exporter + -o /bin/solace_prometheus_exporter FROM scratch -LABEL maintainer="Daniel Brunold " +LABEL maintainer="https://github.com/solacecommunity/solace-prometheus-exporter" ENV SOLACE_LISTEN_ADDR="0.0.0.0:9628" ENV SOLACE_SCRAPE_URI=http://localhost:8080 @@ -30,9 +30,9 @@ ENV SOLACE_SSL_VERIFY="false" ENV SOLACE_REDUNDANCY="false" EXPOSE 9628 -ENTRYPOINT [ "/solace_exporter" ] +ENTRYPOINT [ "/solace_prometheus_exporter" ] CMD [ ] COPY --from=builder /etc/passwd /etc/passwd -COPY --from=builder /bin/solace_exporter /solace_exporter +COPY --from=builder /bin/solace_prometheus_exporter /solace_prometheus_exporter diff --git a/README.md b/README.md index 218bc8e..44cad34 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,19 @@ # solace-prometheus-exporter, a Prometheus Exporter for Solace Message Brokers ## Overview -TODO: Fill in with quick explanation and maybe an arch diagram from the video. + +![Archtiecture overview](/doc/architecture_001.png) + +The exporter is written in go, based on the Solace Legacy SEMP protocol. +I graps metrics via SEMP v1 and provide those as prometheus friendly http endpoints. + Video Intro available on youtube: [Integrating Prometheus and Grafana with Solace PubSub+ | Solace Community Lightning Talk ](https://youtu.be/72Wz5rrStAU?t=35) ## Features -The exporter is written in go, based on the Solace Legacy SEMP protocol.
-It implements the following endpoints:
+It implements the following endpoints: ``` http://:/ Document page showing list of endpoints http://:/metrics Golang and standard Prometheus metrics @@ -23,27 +27,35 @@ http://:/solace-vpn-std Solace Vpn only Standard Metrics (VPN), http://:/solace-vpn-stats Solace Vpn only Statistics Metrics (VPN), available to non-global access right admins http://:/solace-vpn-det Solace Vpn only Detailed Metrics (VPN), available to non-global access right admins ``` -The [registered](https://github.com/prometheus/prometheus/wiki/Default-port-allocations) default port for Solace is 9628
+There are 3 type that have different performance criticality. +- std: not harm the broker performance +- stats: may slow down your broker a little +- det: will harm broker performance, if you have up to 1000 queues + +If you are running a cloud broker, you should use the `solace-vpn` endpoints. Because you will not have the permissions required for the global one. + +The [registered](https://github.com/prometheus/prometheus/wiki/Default-port-allocations) default port for Solace is 9628 ## Usage ``` -solace_exporter -h -usage: solace_exporter [<flags>] +solace_prometheus_exporter -h +usage: solace_prometheus_exporter [<flags>] Flags: -h, --help Show context-sensitive help (also try --help-long and --help-man). --log.level=info Only log messages with the given severity or above. One of: [debug, info, warn, error] --log.format=logfmt Output format of log messages. One of: [logfmt, json] - --config-file=CONFIG-FILE Path and name of config file. See sample file solace_exporter.ini. + --config-file=CONFIG-FILE Path and name of config file. See sample file solace_prometheus_exporter.ini. ``` -The configuration parameters can be placed into a config file or into a set of environment variables or can be given via URL. For Docker you should prefer the environment variable configuration method (see below).
If the exporter is started with a config file argument then the config file entries have precedence over the environment variables. If a parameter is neither found in URL nor the config file nor in the environment the exporter exits with an error.
+The configuration parameters can be placed into a config file or into a set of environment variables or can be given via URL. For Docker you should prefer the environment variable configuration method (see below). +If the exporter is started with a config file argument then the config file entries have precedence over the environment variables. If a parameter is neither found in URL nor the config file nor in the environment the exporter exits with an error. ### Config File ```bash -solace_exporter --config-file /path/to/config/file.ini +solace_prometheus_exporter --config-file /path/to/config/file.ini ``` Sample config file: @@ -121,7 +133,7 @@ Security: Only use this feature with HTTPS. ### Default Build ```bash -cd <some-directory>/solace_exporter +cd <some-directory>/solace-prometheus-exporter go build ``` @@ -159,6 +171,12 @@ docker run -d \ The sub directory **testfiles** contains some sample curl commands and their outputs. This is just fyi and not needed for building. +## Security + +Please enshure to run this application only in an secured network or protected by a proxy. +It may reveald insigts of your application you dont want. +If you use the feature to pass broker credentials via HTTP body/header. You are forced to run this application within kubernetes/openshift or simular to add a HTTPS layer. + ## Resources For more information try these resources: diff --git a/doc/architecture_001.png b/doc/architecture_001.png new file mode 100644 index 0000000..d5d6f77 Binary files /dev/null and b/doc/architecture_001.png differ diff --git a/solace_exporter.go b/solace_prometheus_exporter.go old mode 100755 new mode 100644 similarity index 99% rename from solace_exporter.go rename to solace_prometheus_exporter.go index 2019754..5048e77 --- a/solace_exporter.go +++ b/solace_prometheus_exporter.go @@ -1546,7 +1546,7 @@ func main() { configFile := kingpin.Flag( "config-file", - "Path and name of ini file with configuration settings. See sample file solace_exporter.ini.", + "Path and name of ini file with configuration settings. See sample file solace_prometheus_exporter.ini.", ).String() kingpin.Parse() @@ -1558,7 +1558,7 @@ func main() { os.Exit(1) } - level.Info(logger).Log("msg", "Starting solace_exporter", "version", solaceExporterVersion) + level.Info(logger).Log("msg", "Starting solace_prometheus_exporter", "version", solaceExporterVersion) level.Info(logger).Log("msg", "Build context", "context", version.BuildContext()) level.Info(logger).Log("msg", "Scraping", diff --git a/solace_exporter.ini b/solace_prometheus_exporter.ini similarity index 100% rename from solace_exporter.ini rename to solace_prometheus_exporter.ini