From b741a572373ac858d1e6597c4f5413ecdabadcd5 Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Mon, 18 Nov 2013 07:14:13 +0000 Subject: [PATCH] Document user-defined metadata for swift samples Add a brief documentation on how to configure and use user-defined metadata for swift samples based on 'metadata_headers' property in swift middleware. Change-Id: I365db3fda74a6e6ef0e8bcfbad917bcdac8e02ee --- doc/source/install/manual.rst | 7 +++++++ doc/source/measurements.rst | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/doc/source/install/manual.rst b/doc/source/install/manual.rst index b32b4a476..8530ec319 100644 --- a/doc/source/install/manual.rst +++ b/doc/source/install/manual.rst @@ -64,6 +64,13 @@ Installing the Collector And adding ``ceilometer`` in the ``pipeline`` of that same file, right before ``proxy-server``. + Additionally, if you want to store extra metadata from headers, you need + to set ``metadata_headers`` so it would look like:: + + [filter:ceilometer] + use = egg:ceilometer#swift + metadata_headers = X-FOO, X-BAR + 4. Install MongoDB. Follow the instructions to install the MongoDB_ package for your diff --git a/doc/source/measurements.rst b/doc/source/measurements.rst index fb0156867..a89afa12f 100644 --- a/doc/source/measurements.rst +++ b/doc/source/measurements.rst @@ -198,7 +198,7 @@ If you plan on adding meters, please follow the convention bellow: 3. If you have any hesitation, come and ask in #openstack-metering -User-defined sample metadata (nova only) +User-defined sample metadata for Nova ========================================= Users are allowed to add additional metadata to samples of nova meter. @@ -210,3 +210,17 @@ To do so, users should add nova user metadata prefixed with 'metering.': Note: The name of the metadata shouldn't exceed 256 characters otherwise it will be cut off. Also, if it has '.', this will be replaced by a '_' in ceilometer. + +User-defined sample metadata for Swift +========================================== +It's possible to add additional metadata to sample of Swift meter as well. +You might specify headers whose values will be stored in resource_metadata as +'resource_metadata.http_header_$name', where $name is a name of the header with +'-' replaced by '_'. + +This is done using 'metadata_headers' option in middleware configuration, +refer to :ref:`installing_manually` for details. + +For example, this could be used to distinguish external and internal users. You'd +have to implement a custom Swift middleware that sets a proper header and just add +it to metadata_headers.