Commit Graph

35 Commits

Author SHA1 Message Date
Matthias Runge 92be85c4ca Remove leftovers of retirement
Change-Id: I5acab95813ac3d0604f73c377bf111f423a008bc
2021-07-09 15:21:47 +02:00
Matthias Runge ca45bbdca0 Retire panko, the code is no longer maintained.
The contents of this repository are still available in the Git source
code management system. To see the contents of this repository before it
reached its end of life, please check out the previous commit with
"git checkout HEAD^1".

For any further questions, please email
openstack-discuss@lists.openstack.org or join #openstack-telemetry on OFTC.

Change-Id: Ic8a7001e708d8da7cf8951eefd0a96762ea5fa46
2021-05-27 11:36:44 +02:00
Zuul 053b147b48 Merge "[goal] Deprecate the JSON formatted policy file" 2021-05-17 11:10:59 +00:00
likui 9f190a5cea Replace getargspec with getfullargspec
inspect.getargspec() is deprecated since py3

[1] https://docs.python.org/3/library/inspect.html#inspect.getargspec

Change-Id: I1a838b0e0ac9b582c4176c43962904ab31b6d5d9
2021-05-11 16:24:16 +08:00
Ghanshyam Mann 6da394a59a [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: Ie6e22b0b47c5148290f7b76c95967cd9a343343c
2021-02-11 12:40:40 -06:00
wangzihao f95cff99e2 Remove six
Remove six Replace the following items with Python 3 style code.

- six.text_type
- six.PY3
- six.moves.urllib
- six.string_types
- six.iteritems
- six.integer_types
- six.binary_type
- six.add_metaclass
- six.moves.reprlib

Depends-on: https://review.opendev.org/c/openstack/telemetry-tempest-plugin/+/770955
Change-Id: Ia301d56d675557e81b873ddd68f1faeb051dfe93
2021-01-15 16:48:21 +00:00
Andreas Jaeger e66d3e7599 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Update local hacking checks to work with new flake8 version.

Change-Id: Id5d224358b44fd7ab4bd3d08f1db6b6faf54042f
2020-04-03 14:39:18 +02:00
zhurong 92a0a825e5 PDF documentation build
Change-Id: I7db6a34ba582c048c40c450453f239ada6260ac2
2019-09-19 22:39:38 -07:00
zhulingjie 789f7c3e16 Update json module to jsonutils
oslo project provide jsonutils, the others project use it
this PS to update the json moudule to oslo jsonutils.

Change-Id: I311d4f9dec7b685a5bccb9725de6010926375c7d
2019-06-03 11:13:54 +00:00
Tovin Seven 619b7e1ee0 Integrate OSprofiler in Panko
* Add osprofiler wsgi middleware. This middleware is used for 2 things:
  1) It checks that person who wants to trace is trusted and knows
     secret HMAC key.
  2) It starts tracing in case of proper trace headers
     and adds first wsgi trace point, with info about HTTP request

* Traces HTTP API calls
* Traces DB (SQLAlchemy) calls

Demo: https://tovin07.github.io/panko/openstack-event-list.html

HOW TO TEST?

1. Install devstack with panko as usual

2. Install osprofiler

    pip install osprofiler

3. Add these line to /etc/panko/panko.conf

   [profiler]
   enabled = true
   hmac_keys = SECRET_KEY
   connection_string = redis://localhost:6379 # example when using redis

4. Pass HMAC_KEYS to client commands
    - panko client with `--profile <HMAC_KEYS>`
    - openstack client with `--os-profiler <HMAC_KEYS>`

Output will look like this:

To display trace use the command:

  osprofiler trace show --html <TRACE_ID>

5. Use osprofiler to get the trace

    osprofiler trace show \
        --connection-string redis://localhost:6379 \
        --out out.html \
        --html <TRACE_ID>

6. Open that html file with browser and view the result

Change-Id: Ic934acbe1340a3e00361f2709f34725e0e4aa3ba
2019-04-12 02:18:28 +00:00
Julien Danjou 14a10f9a73 Revert "Operator for start/end_timestamp changes to 'eq'"
This reverts commit b540674a84.

This changes is wrong in the sense as it removes the ability to filter via ge/le the start and end timestamps.

Change-Id: I0c82917a6fd6795266e34b4d151faf13f43ab5bb
2018-04-18 14:08:52 +00:00
Zuul 48b3c63cb5 Merge "Move default policies into code" 2017-11-28 20:19:08 +00:00
Lance Bragstad 52417d4ab8 Move default policies into code
This is part of a community effort to provide better user experience
for those having to maintain RBAC policy. More information on this
effort can be found below:

  https://governance.openstack.org/tc/goals/queens/policy-in-code.html

bp policy-and-docs-in-code
Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Change-Id: I9bad70abcf5543c3e5e5da25c56c408ee3ff0346
2017-11-08 04:35:54 +00:00
Zuul f4f1a4069f Merge "Support admin to get all events" 2017-11-06 08:36:43 +00:00
zhang-shaoman f7d5e0564a Support admin to get all events
Currently admin can only get project_id consistent events, while
sometimes admin need to get all the events, so add a parameter
"all_tenants" for the api to achieve this purpose.

Change-Id: I7c479a63c41d4b0fbf645bdb1b70f0259b0cb859
2017-11-03 11:19:42 +08:00
astacksu b540674a84 Operator for start/end_timestamp changes to 'eq'
start/end_timestamp originally are associated with op 'ge' and 'le'.
Changing them to 'eq' fixes the bug and the usage will make more sense.

Related review: https://review.openstack.org/#/c/495763
Change-Id: Ia94a499f9340102553863db48dccb96bea92ea78
Closes-Bug: #1711997
2017-09-15 09:05:07 +08:00
shangxiaobj eea3eef269 Fix typos and replace http with https for doc links
1) Fix typos found in panko
2) Use https instead of http for docs links in panko

Change-Id: Iccc8e0c612d6681bf39dec6b7b79b5ad30a23eca
2017-08-17 23:52:20 -07:00
Jenkins 868dddf2b6 Merge "Add field description" 2017-07-25 17:44:56 +00:00
Boris Bobrov c677b23960 Add field description
It was not documented how to filter based on `generated` field.

Added a field and a description for it so that it gets rendered in the
docs.

Change-Id: I3f4929ce4876015817e230d8855dbccbd5d34e27
2017-06-30 15:45:07 +03:00
gord chung 36da6822c5 add noauth api pipeline
Change-Id: Ib12fa4270c6780338cb9eba486833c32f3809c27
2017-05-25 22:42:00 +00:00
loooosy 3084860863 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.
See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I877d8897d3e314903e704073868aaa877eac8167
2017-04-08 22:14:11 +08:00
Jenkins 7f9694f84c Merge "remove event_* prefixes" 2017-01-23 13:02:52 +00:00
Jenkins 5a60c80925 Merge "remove event redundancy" 2017-01-23 12:49:30 +00:00
Jeremy Liu d5acf9df51 Optimize policy engine initialization
Those code are duplicate, just wrap them into `init` function.

Change-Id: Id4fe904a18dd3fc6efb9e5c7eb32220e63dca74f
2017-01-18 16:34:10 +08:00
gord chung 97742e644d remove event_* prefixes
we don't need this.

Change-Id: Ia2008bb8de5335776b58b8e5e5f69f7ec88d30b9
2017-01-13 20:50:14 +00:00
gord chung 41f345f552 remove event redundancy
- we don't need to prefix 'event/storage' because that's all panko
does. cleanup inline with aodh.
- test_hbase_table_utils is not used anywhere and last reference
was from icehouse.
- drop a few places that use 'event_*' prefix since it wastes line
space

Change-Id: I348f5a3dfb59682589b4912eaed4e4b8abb15ebb
2017-01-13 09:03:48 -05:00
zhangguoqing f17f7d6690 Replaces uuid.uuid4 with uuidutils.generate_uuid()
Openstack common has a wrapper for generating uuids. We should
use that function when generating uuids for consistency.

Change-Id: I839aef8095960ebe00e6e7992c5415b7d7dfa3d9
Closes-Bug: #1082248
2016-12-07 04:28:26 +00:00
gengchc2 2bba73d118 Translate info-level log messages for LOG.error
The Log "LOG.error(_LE(...)" is used in some places,but
the log "LOG.error(_(..))"  still used in a few places.

Change-Id: I624d1f8dd770ff9802cfa0b0c56cf0501aa1a0fc
2016-11-17 08:45:26 +00:00
Julien Danjou dc07901fbc Remove pecan_debug option
There's no need to have this exposed to users.

Change-Id: Ie2cc75f167421fcc306f35bcd8e1a797fe7d35b1
2016-10-12 19:08:53 +02:00
Amy Fong 272c872f2f Enable paginate query for event listing
sorting and marker options are enabled for event listing (for sqlalchemy only)
using oslob.db.

    sort -- list of sorting criteria. Each sorting option has to format
            <sort key>:<sort direction>

            Valid sort keys: message_id, generated
            Valid sort directions: asc (ascending), desc (descending)
                    This defaults to asc if unspecified

            If sort list is unspecified, this defaults to
            ['generated:asc', 'message_id:asc']

    marker -- If specified, assumed to be an integer and assumed to be the
              message id of the last object on the previous page of the results

limit is still available and supported for non sqlalchemy databases

Closes-bug: #1615699
Change-Id: I0441ca6283be5859c09c3d381ffbb52ca4a79eca
2016-10-04 14:06:01 -04:00
xiaozhuangqing 910189c3d3 Remove unused import logging and LOG object
Change-Id: I7fb66b8d75bfb6e2e0aa88a42dff67b60710833a
2016-09-06 11:39:08 +08:00
Julien Danjou 671f533eff Use pbr to build WSGI script `panko-api'
Change-Id: Ic3ac49bd8143461ec4011c34ea97283431fb3939
2016-07-22 12:23:34 +02:00
Julien Danjou a6314e99e8 events: fix operator check in event filter
Currently, the query is checked against the `eq' operator, which is
wrong. The SQLAlchemy driver code only implements one operator, which is
gt/ge/eq depending on the field. This patches fixes that correctly in
the API.

(cherry-pick from commit 36df404e4202a821110e19bc8db554120ea1b7ae from Ceilometer)

Change-Id: Ife02ef6166902120f5e10103d73bb009713cb3bf
2016-07-12 19:07:24 +02:00
Julien Danjou 95abeb8b06 Stop relying on global CONF object
The conf object is now prepared on demand by panko.service.prepare_service.

Change-Id: I3526e73f8acbcb089d42850c0762305a08726db7
2016-06-27 17:03:38 +02:00
Julien Danjou 3009be7ee7 Rename to Panko
Change-Id: I50b5f6c7b74a4431ccb7af271c11fe9c027f83ab
Signed-off-by: Julien Danjou <julien@danjou.info>
2016-06-14 17:00:22 +02:00