Sign inSign up

monasca/log-api

By monasca

•Updated almost 6 years ago

Image
0

5.1K

monasca/log-api repository overview

⁠monasca-log-api

This image contains containerized version of Monasca Log API. For more details about monasca-log-api, please visit:

⁠Tags

The images in this repository follow a few tagging conventions:

  • latest: refers to the latest stable Python point release, e.g. 2.2.1
  • 2.2.1, 2.2, 2: standard semver tags, based on git tags in the official repository⁠
  • ocata: named versions following OpenStack release names built from the tip of the stable/RELEASENAME branches in the repository
  • master, master-DATESTAMP: unstable builds from the master branch, not intended for general use

⁠Usage

In order to run monasca-log-api container, Kafka⁠ needs to be available. Once it is, monasca-log-api can be launched using docker run -p 5607:5607 -l kafka monasca/log-api:latest .

⁠Configuration

A number of environment variables can be passed to the container:

VariableDefaultDescription
LOG_LEVEL_ROOTWARNThe level of the root logger
LOG_LEVEL_CONSOLEINFOMinimum level for console output
LOG_LEVEL_ACCESSINFOMinimum level for access output
MONASCA_CONTAINER_LOG_API_PORT5607The Log API's HTTP port
KAFKA_URIkafka:9092The host and port for kafka
KAFKA_WAIT_FOR_TOPICSlogTopics to wait on at startup
KAFKA_WAIT_RETRIES24# of kafka wait attempts
KAFKA_WAIT_DELAY5seconds to wait between attempts
KEYSTONE_IDENTITY_URIhttp://keystone:35357Keystone identity address
KEYSTONE_AUTH_URIhttp://keystone:5000Keystone auth address
KEYSTONE_ADMIN_USERadminKeystone admin account user
KEYSTONE_ADMIN_PASSWORDsecretadminKeystone admin account password
KEYSTONE_ADMIN_TENANTadminKeystone admin account tenant
KEYSTONE_ADMIN_DOMAINdefaultKeystone admin domain
MEMCACHED_URImemcached:11211A list of URIs pointing at memcached
AUTHORIZED_ROLESadmin, domainuser, domainadmin, monasca-userRoles for admin Users
AGENT_AUTHORIZED_ROLESmonasca-agentRoles for metric write only users
GUNICORN_WORKERS9number of API worker processes
GUNICORN_WORKER_CLASSgeventasync worker class
GUNICORN_WORKER_CONNECTIONS2000no. connections for async worker
GUNICORN_BACKLOG1000gunicorn backlog size
GUNICORN_TIMEOUT1000gunicorn timeout
ADD_ACCESS_LOGtrueif true, produce an access log on stderr
ACCESS_LOG_FORMAT%(asctime)s [%(process)d] gunicorn.access [%(levelname)s] %(message)sLog format for access log
ACCESS_LOG_FIELDS%(h)s %(l)s %(u)s %(t)s %(r)s %(s)s %(b)s "%(f)s" "%(a)s" %(L)sAccess log fields

If additional values need to be overridden, new config files or jinja2 templates can be provided by mounting a replacement on top of the original template:

  • /etc/monasca/log-api.conf.j2
  • /etc/monasca/log-api-paste.ini.j2
  • /etc/monasca/log-api-logging.conf.j2

If jinja2 formatting is not desired, the environment variable CONFIG_TEMPLATE can be set to false. Note that the jinja2 template should still be overwritten (rather than the target file without the .j2 suffix) as it will be copied at runtime.

The config file sources are available in the repository⁠. If necessary, the generated config files can be viewed at runtime by running:

docker exec -it some_container_id cat /etc/monasca/log-api.conf
docker exec -it some_container_id cat /etc/monasca/log-api-paste.ini
docker exec -it some_container_id cat /etc/monasca/log-api-logging.conf

⁠Troubleshooting

Container status can be checked by the following command (example):

docker ps --filter 'name=log-api' --format '{{.Names}}\t{{.Image}}\t{{.Status}}'

Result of health check can be get by the following command:

docker inspect --format '{{json .State.Health}}' log-api | python -m json.tool

Health check ExitCodes:

  • 1: Monasca API error

Tag summary

Content type

Image

Digest

Size

45.3 MB

Last updated

over 8 years ago

docker pull monasca/log-api