Commit Graph

20 Commits

Author SHA1 Message Date
Witek Bedyk 3014c840d6 Set legacy_kafka_client_enabled = False on default
We change the default value of kafka.legacy_kafka_client_enabled from
True to False. The use of new Confluent Kafka client is recommended.

DevStack plugin does not set this option anymore.

Depends-On: https://review.opendev.org/740959
Depends-On: https://review.opendev.org/740966
Change-Id: I4d57b8893a6a131769009dc3299789d3fc89bab6
Story: 2007924
Task: 40338
2020-07-14 16:15:23 +02:00
Doug Szumski f4dce6c37d Support batching metrics when writing to Kafka
When a large post (> 10s of MB) is made to the Monasca API an attempt
is made to write these metrics to the metrics topic in Kafka. However, due to
the large size of the write, this can fail with a number of obscure errors
which depend on exactly how much data is written. This change supports
splitting the post into chunks so that they can be written to Kafka in
sequence. A default has been chosen so that the maximum write to Kafka
should be comfortably under 1MB.

A future extension could support splitting the post by size, rather than the
number of measurements. A better time to look at this may be after the
Python Kafka library has been upgraded.

Story: 2006059
Task: 34772
Change-Id: I588a9bc0a19cd02ebfb8c0c1742896f208941396
2019-11-15 16:33:15 +00:00
Ghanshyam Mann 159bc64f41 Correct the IPv6 address and port parsing
There can be lot of possibility for IPv6 address with port,
for example [::1]:80 or [2001:db8:85a3::8a2e:370]:7334.

Parsing that in more standard way is provided by oslo_uilts.netutils
parse_host_port() method[1].

Also unquote '[]' the SERVICE_HOST in case of IPv6 case so that
DB can listen on correct address.

Story: #2006309
Task: #36028

[1] 1b8bafb391/oslo_utils/netutils.py (L37)

Change-Id: I2d0ef40ab71f60564549d031185f99bc7eec40a7
2019-10-22 10:19:07 +00:00
Zuul 313a3ad7af Merge "Merge log-api and api" 2019-09-27 17:53:02 +00:00
Bharat Kunwar 967b918bae Implement separate db per tenancy
At present, all time series are accumulated in the same database in
InfluxDB. This makes queries slow for tenants that have less data. This
patch enables the option to use separate database per tenancy.

This changeset implements the changes on monasca-api which handles read
requests to InfluxDB database.

It also updates the relevant docs providing link to the migration tool
which enables users to migrate their existing data to a database per
tenant model.

Change-Id: I7de6e0faf069b889d3953583b29a876c3d82c62c
Story: 2006331
Task: 36073
2019-09-27 14:24:37 +00:00
Adrian Czarnecki d2379a018e Merge log-api and api
*Merge monasca-log-api into merge-api
*Enable logs endpoints
*Add configuration that allow to enable/disable metrics and logs part
*Remove redundant log-api source code

Story: 2003881
Task: 30533
Change-Id: Iaa5689694e7081f3375f1a2235cad31d6a7b5f76
2019-09-26 12:02:20 +02:00
Witek Bedyk 47c5ad37d5 Use Confluent Kafka client
The change introduces the possibility to run the API with the new
confluent-kafka client. It has to be enabled in the configuration file.

Story: 2003705
Task: 35859

Depends-On: https://review.opendev.org/680653
Change-Id: Id513e01c60ea584548c954a8d2e61b9510eee8de
2019-09-24 09:41:17 +00:00
Shubham82 6cc6c9ba4f Switch python3 versions of test jobs to match Train PTI
In Train, we will use python 3.6 and 3.7 for python3 runtime
in our gate jobs [1]. This commit also adds python 3.7.
In Python3.7 async is a reserved keyword so replacing it with is_async.

[1] https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I05f40c4a9304cad551cefd4f10c3ba9a72d69a6f
2019-07-26 14:31:42 +05:30
zhangjianweibj dbe1ea8b50 Support cassandra connection timeout option
Creating a cassandra connection can be limited by connection_timeout option.

Story: 2005450
Task: 30502

Change-Id: I8803e28fe8c2c11e819be44db4ef93cb19b47a1d
2019-05-30 11:34:15 +00:00
zhangjianweibj 0b1bb93206 cassandra cluster no load-balancing policy
monasca-api connect to cassandra cluster without
load-balancing policy parameter.
Task: 29958
Story: 2005196

Change-Id: Ia740f20f6b8d557a74a48cd0c78cd07c1500ca94
2019-04-11 09:33:18 +08:00
zhangjianweibj 1f0df6a985 Configure Cassandra cluster port
monasca-api can not config cassandra port.
Task: 29872
Story: 2005156

Change-Id: I007cc5f76d401b82cf5dc3c8819ec2bb3faf3bca
2019-03-14 18:47:21 +08:00
Zuul bc6ba3b303 Merge "Set proper default agent authorized role" 2018-11-20 11:41:55 +00:00
Witold Bedyk d1fd496953 Remove deprecated database.url option
It has been deprecated in Ocata release. `database.connection` should be
used instead.

Change-Id: I8ed5f0e248531e1cada182e43cebe44edb324148
Story: 2004257
Task: 27793
2018-11-06 16:03:13 +00:00
Dobroslaw Zybort 856a969da3 Set proper default agent authorized role
Story: 2003930
Task: 26838

Change-Id: I27f191d1baf850d5b9e56928fd6b45818f430216
2018-10-17 14:01:05 +02:00
Amir Mofakhar 3ca4b057dd Using oslo.policy for monasca-api
Added policies and used policy enforcement engine
from monasca-common.

- Replaced security with oslo.policy
- Updated unit tests and implemented some new tests
- Added a new entry point for generating sample policy file by tox

story: 2001233
task: 6355

Change-Id: I4aa444fe6ec883160c03c201145c77994b6615f9
Signed-off-by: Amir Mofakhar <amofakhar@op5.com>
2018-06-05 12:25:07 +00:00
Adrian Czarnecki 2e078cdd87 Change default authorized role
monasca-user role is more sufficient then admin role.

Story: 2001895
Task: 14380
Change-Id: I16091dbd631a5e94d08598a23eeb3bdf97cf0a92
2018-04-24 12:26:59 +02:00
Jui Chandwaskar 03bd329dd0 Update pep8 checks
* Update max line length to 100
* Clean up code for pep8 checks

Change-Id: Ibde2939831e6eeaab3db66fbc18255c71592bb41
Signed-off-by: Jui Chandwaskar <jchandwaskar@op5.com>
2018-04-11 12:40:27 +02:00
James Gu 4a6015ad65 Add password authentification in monasca-api with Cassandra
Add the support to configure user and password in monasca api and enforce
the authetification when connecting to cassandra db when the user and
password is set.

Change-Id: I9e6689e0e8e6e97d5cff3a59aecb53483ec320bd
story: 2001471
task: 6191
2018-01-29 15:38:16 -08:00
James Gu ba43f07726 Add cassandra support
Support Cassandra db installation and Cassandra related
configurations for Monasca api and persister services
in devstack. Add Monasca rest API Cassandra plugin for
retrieving metric, dimension, measurement, statistics
and alarms.

Change-Id: Ie60d668692e1f25f555dda2355f4e513d582736c
story: 2001231
task: 5759
2017-12-15 19:11:00 +00:00
Tomasz Trębski 5d27af4079 Config-generator for monasca-api
Change migrates the monasca-api to use oslo-config-generator in
order to always build newest configuration file. That removes
the need of maintaning the file along with changes to oslo configuration.
The example of the file is also included in the documentation.

Also:
* ported case for launching api under WSGI and allowing the argument
  parsing of oslo to take place

Story: 2000970
Task: 4865

Story: 2000964
Task: 4106

Change-Id: I57547b0e2122e40f58db5f949773900b76214526
2017-08-28 06:58:57 +00:00