Skip to content

Commit

Permalink
Renaming and docu improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenRover committed Jan 26, 2021
1 parent 39859f5 commit 549f908
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
go.sum
solace_exporter
solace_exporter.exe
solace_prometheus_exporter
*.exe
.vscode
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
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
Expand All @@ -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
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br/>
It implements the following endpoints:<br/>
It implements the following endpoints:
```
http://<host>:<port>/ Document page showing list of endpoints
http://<host>:<port>/metrics Golang and standard Prometheus metrics
Expand All @@ -23,27 +27,35 @@ http://<host>:<port>/solace-vpn-std Solace Vpn only Standard Metrics (VPN),
http://<host>:<port>/solace-vpn-stats Solace Vpn only Statistics Metrics (VPN), available to non-global access right admins
http://<host>:<port>/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<br/>
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 [&lt;flags&gt;]
solace_prometheus_exporter -h
usage: solace_prometheus_exporter [&lt;flags&gt;]
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.</code></pre>
--config-file=CONFIG-FILE Path and name of config file. See sample file solace_prometheus_exporter.ini.</code></pre>
```

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).<br/> 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.<br/>
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:
Expand Down Expand Up @@ -121,7 +133,7 @@ Security: Only use this feature with HTTPS.

### Default Build
```bash
cd &lt;some-directory&gt;/solace_exporter
cd &lt;some-directory&gt;/solace-prometheus-exporter
go build
```

Expand Down Expand Up @@ -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:
Expand Down
Binary file added doc/architecture_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions solace_exporter.go → solace_prometheus_exporter.go
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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",
Expand Down
File renamed without changes.

0 comments on commit 549f908

Please sign in to comment.