GRÅCC HTTP Collector Service
10K+
The gracc-collector is a "Gratia-Compatible Collector" that acts as a transitional interface between the obsolete Gratia accounting collector and probes and the new GRÅCC accounting system.
It listens for bundles of records (as would be sent via replication from a Gratia collector or from a Gratia probe) on HTTP, processes the bundle into individual usage records, and sends those to RabbitMQ or another AMQP 0.9.1 broker.
The config file is TOML format. Config options can also be specified by environment variables, shown below in parentheses. Environment variables override file settings.
address = "localhost" # address to listen on (GRACC_ADDRESS)
port = "8888" # port to listen on (GRACC_PORT)
timeout = "60s" # HTTP connection timeout (GRACC_TIMEOUT)
loglevel = "debug" # log level [debug|info|warn|error|fatal|panic] (GRACC_LOGLEVEL)
[AMQP]
scheme = "amqp" # AMQP URI scheme [amqp|amqps] (GRACC_AMQP_SCHEME)
host = "localhost" # AMQP broker (GRACC_AMQP_HOST)
port = "5672" # (GRACC_AMQP_PORT)
vhost = "" # (GRACC_AMQP_VHOST)
exchange = "" # (GRACC_AMQP_EXCHANGE)
routingKey = "" # (GRACC_AMQP_ROUTINGKEY)
durable = true # keep exchange between server restarts (GRACC_AMQP_DURABLE)
autoDelete = true # delete exchange when there are no remaining bindings (GRACC_AMQP_AUTODELETE)
user = "guest" # (GRACC_AMQP_USER)
password = "guest" # (GRACC_AMQP_PASSWORD)
format = "raw" # format to send record in [raw|xml|json] (GRACC_AMQP_FORMAT)
retry = "10s" # AMQP connection retry interval (GRACC_AMQP_RETRY)
gracc-collector [-c <config file>] [-l <log file>] [-pprof on|<address:port>]
Where <log file> can be "stdout", "stderr", or a file name; default is "stderr".
-pprof on will expose pprof on the main http server at /debug/pprof/.
-pprof <address:port> will expose it on a separate http server as specified, also at /debug/pprof/.
See sample/gracc.service for a sample systemd unit configuration. Copy the file (with
appropriate changes) to /usr/lib/systemd/system/ then use standard systemd commands to
control the process.
systemctl start gracc.servicesystemctl stop gracc.servicesystemctl restart gracc.servicesystemctl kill --signal=SIGUSR1 gracc.servicesystemctl kill --signal=SIGUSR2 gracc.serviceSee sample/gracc.logrotate for a sample logrotate configuration. Copy the file (with
appropriate changes) to /etc/logrotate.d/gracc.
To create a release, one must do the following:
README.md and gracc-collector.spec.gracc-collector GitHub repository; this will create a new release.gracc-collector packaging there;
you will need to at least copy over the gracc-collector.spec and the update the git SHA1
associated with the release. Steps 1-3 should take 15 minutes.gracc-collector RPM in Koji.
This should take 15 minutes.gracc-collector RPM to the osg-development
repository. Estimated wait time is 2 hours.make release; this will update the local Dockerfile and perform a commit. Run
docker build . to ensure the generated image contains the correct gracc-collector version.Fix resource leak when rabbitmq is down.
Add configurable AMQP scheme to support TLS connections to broker.
Accept UsageRecord (treated identically as JobUsageRecord).
Fully flatten JobUsageRecord into simple key:value hash map.
Revised JSON output structure based on OGF UsageRecord and switch default output to JSON.
Significant rewrite to simplify while maintaining robust error handling.
Created internal queues for outputting records.
Add basic collector statistics served at /stats.
Add option to write records to RabbitMQ.
Add option to write records to file.
Add option to send records to Kafka topic.
Initial dev version, send records to Elasticsearch.
docker pull opensciencegrid/gracc-collector:latest