├── .dockerignore ├── .drone.yml ├── .gitignore ├── .travis.yml ├── Dockerfile ├── LICENSE ├── README.md ├── entrypoint.sh ├── go.mod ├── go.sum ├── main.go ├── metrics └── metrics.go ├── storage ├── client.go ├── client_test.go ├── constants.go ├── spl_engine.go └── spl_engine_test.go └── test ├── log.go └── test.go /.dockerignore: -------------------------------------------------------------------------------- 1 | README.md 2 | LICENSE 3 | Dockerfile 4 | -------------------------------------------------------------------------------- /.drone.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | kind: pipeline 4 | type: docker 5 | 6 | steps: 7 | - name: test 8 | image: golang:1.13 9 | commands: 10 | - go test ./... 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | dist/ 8 | vendor/ 9 | 10 | # Test binary, build with `go test -c` 11 | *.test 12 | 13 | # Output of the go coverage tool, specifically when used with LiteIDE 14 | *.out 15 | .idea/ 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.13.x 5 | 6 | go_import_path: github.com/kebe7jun/ropee 7 | 8 | 9 | script: 10 | - go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... 11 | 12 | after_success: 13 | - bash <(curl -s https://codecov.io/bash) 14 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.13-stretch 2 | 3 | ENV GO111MODULE=on 4 | ENV CGO_ENABLED=0 5 | ENV GOOS=linux 6 | ENV GOARCH=amd64 7 | 8 | WORKDIR /go/cache 9 | 10 | ADD go.mod . 11 | RUN go mod download 12 | 13 | WORKDIR /app 14 | 15 | ADD . . 16 | 17 | ARG build_tags 18 | 19 | RUN if [ ! -n $build_tags ]; then go build -tags $build_tags -o ./dist/ropee ; else go build -o ./dist/ropee ; fi 20 | 21 | FROM alpine:3.8 22 | 23 | COPY --from=0 /app/dist/ropee /usr/local/bin 24 | COPY entrypoint.sh /usr/local/bin 25 | 26 | RUN chmod +x /usr/local/bin/entrypoint.sh 27 | 28 | ENTRYPOINT /usr/local/bin/entrypoint.sh 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ropee -- A prometheus remote storage adapter for splunk 2 | 3 | [![Build Status](https://travis-ci.org/kebe7jun/ropee.svg)](https://travis-ci.org/kebe7jun/ropee) 4 | [![codecov](https://codecov.io/gh/kebe7jun/ropee/branch/master/graph/badge.svg)](https://codecov.io/gh/kebe7jun/ropee) 5 | [![GolangCI](https://golangci.com/badges/github.com/kebe7jun/ropee.svg)](https://golangci.com/r/github.com/kebe7jun/ropee) 6 | 7 | 8 | With this remote storage adapter, Prometheus can use Splunk as a long-term store for time-series metrics. 9 | 10 | 11 | ## Docker instructions 12 | 13 | A docker image for the splunk storage adapter is available on Docker Hub at kebe/ropee. 14 | 15 | ### Start with docker 16 | 17 | ```console 18 | # You must edit the following command for your env. 19 | $ docker run -d --name ropee -p 9970:9970 \ 20 | -e LISTEN_ADDR=0.0.0.0:9970 \ 21 | -e SPLUNK_METRICS_INDEX=metrics \ 22 | -e SPLUNK_METRICS_SOURCETYPE=DaoCloud_promu_metrics \ 23 | -e SPLUNK_HEC_TOKEN=asddsa1-12312312-3123-2 \ 24 | -e SPLUNK_HEC_URL=https://192.168.1.1:8088 \ 25 | -e SPLUNK_URL=https://192.168.1.1:8089 \ 26 | -e TIMEOUT=60 \ 27 | -e DEBUG=0 \ 28 | kebe/ropee:latest 29 | ``` 30 | 31 | ### Command args 32 | ``` 33 | Usage of ./ropee: 34 | -debug 35 | Debug mode. 36 | -listen-addr string 37 | Sopee listen addr. (default "127.0.0.1:9970") 38 | -log-file-path string 39 | Log files path. (default "/var/log") 40 | -splunk-hec-token string 41 | Splunk Http event collector token. 42 | -splunk-hec-url string 43 | Splunk Http event collector url. (default "https://127.0.0.1:8088") 44 | -splunk-metrics-index string 45 | Index name. (default "*") 46 | -splunk-metrics-sourcetype string 47 | The prometheus sourcetype name. (default "DaoCloud_promu_metrics") 48 | -splunk-url string 49 | Splunk Manage Url. (default "https://127.0.0.1:8089") 50 | -timeout int 51 | API timeout seconds. (default 60) 52 | ``` 53 | 54 | ## Configuring Splunk 55 | 56 | ### HEC(HTTP Event Collector) 57 | Please follow splunk docs. 58 | 59 | ### Add SourceType for prom metrics 60 | 61 | props.conf 62 | 63 | ``` 64 | [DaoCloud_promu_metrics] 65 | DATETIME_CONFIG = CURRENT 66 | TRANSFORMS-prometheus_to_metric = prometheus_metric_name_value, prometheus_metric_dims 67 | NO_BINARY_CHECK = true 68 | description = Prometheus Metrics. 69 | SHOULD_LINEMERGE = false 70 | pulldown_type = 1 71 | category = Metrics 72 | ``` 73 | 74 | transforms.conf 75 | ``` 76 | [prometheus_metric_name_value] 77 | REGEX = ^([^\s{]+)({[^}]+})? ([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?) 78 | FORMAT = metric_name::$1 ::$2 _value::$3 79 | WRITE_META = true 80 | 81 | [prometheus_metric_dims] 82 | REGEX = ([a-zA-Z_][a-zA-Z0-9_]*)="([^"]*)"[, ]* 83 | FORMAT = $1::"$2" 84 | REPEAT_MATCH = true 85 | WRITE_META = true 86 | ``` 87 | 88 | ### Add a metric index 89 | Please follow splunk docs. 90 | 91 | 92 | ## Configuring Prometheus 93 | 94 | ``` 95 | ... 96 | remote_read: 97 | - url: "http://127.0.0.1:9970/read" 98 | # for remote read, you should set the basic auth which belongs splunk's user. 99 | 100 | remote_write: 101 | - url: "http://127.0.0.1:9970/write" 102 | 103 | ``` 104 | 105 | ### Building 106 | 107 | ``` 108 | go mod download 109 | go run main.go 110 | ``` 111 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CMD="/usr/local/bin/ropee -log-file-path - " 4 | 5 | args="splunk-url splunk-hec-url splunk-hec-token listen-addr splunk-metrics-index splunk-metrics-sourcetype timeout debug" 6 | 7 | for i in $args 8 | do 9 | env_arg=$(echo $i | sed 'y/abcdefghijklmnopqrstuvwxyz-/ABCDEFGHIJKLMNOPQRSTUVWXYZ_/') 10 | anv_arg_value=$(eval "echo \"\${$env_arg}\"") 11 | if [ ! -z "$anv_arg_value" ]; then 12 | CMD=$CMD"-$i $anv_arg_value " 13 | fi 14 | done 15 | 16 | $CMD 17 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/kebe7jun/ropee 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect 7 | github.com/go-kit/kit v0.9.0 8 | github.com/golang/protobuf v1.3.2 9 | github.com/golang/snappy v0.0.1 10 | github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect 11 | github.com/jonboulle/clockwork v0.1.0 // indirect 12 | github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 // indirect 13 | github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f 14 | github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 // indirect 15 | github.com/prometheus/client_golang v1.2.1 16 | github.com/prometheus/prometheus v1.8.2-0.20190818123050-43acd0e2e93f 17 | github.com/stretchr/testify v1.4.0 // indirect 18 | github.com/tebeka/strftime v0.0.0-20140926081919-3f9c7761e312 // indirect 19 | ) 20 | 21 | replace k8s.io/client-go => k8s.io/client-go v0.0.0-20190620085101-78d2af792bab 22 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 4 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 5 | contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= 6 | github.com/Azure/azure-sdk-for-go v23.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= 7 | github.com/Azure/go-autorest v11.1.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= 8 | github.com/Azure/go-autorest v11.2.8+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= 9 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 10 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 11 | github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= 12 | github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= 13 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 14 | github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= 15 | github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 16 | github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 17 | github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 18 | github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= 19 | github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= 20 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 21 | github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 22 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 23 | github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 24 | github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= 25 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= 26 | github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= 27 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= 28 | github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= 29 | github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= 30 | github.com/aws/aws-sdk-go v1.22.4/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= 31 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 32 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 33 | github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 34 | github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 35 | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= 36 | github.com/cenkalti/backoff v0.0.0-20181003080854-62661b46c409/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= 37 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 38 | github.com/cespare/xxhash v0.0.0-20181017004759-096ff4a8a059/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 39 | github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= 40 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 41 | github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= 42 | github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= 43 | github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= 44 | github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= 45 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 46 | github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 47 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 48 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 49 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 50 | github.com/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 51 | github.com/dgryski/go-sip13 v0.0.0-20190329191031-25c5027a8c7b/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 52 | github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= 53 | github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= 54 | github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= 55 | github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= 56 | github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= 57 | github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= 58 | github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 59 | github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 60 | github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 61 | github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 h1:Ghm4eQYC0nEPnSJdVkTrXpu9KtoVCSo1hg7mtI7G9KU= 62 | github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= 63 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 64 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 65 | github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 66 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 67 | github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= 68 | github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= 69 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 70 | github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= 71 | github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 72 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 73 | github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= 74 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= 75 | github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= 76 | github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= 77 | github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= 78 | github.com/go-openapi/analysis v0.17.2/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= 79 | github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= 80 | github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= 81 | github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= 82 | github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= 83 | github.com/go-openapi/errors v0.17.2/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= 84 | github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= 85 | github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= 86 | github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= 87 | github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= 88 | github.com/go-openapi/jsonpointer v0.17.2/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= 89 | github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= 90 | github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= 91 | github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= 92 | github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= 93 | github.com/go-openapi/jsonreference v0.17.2/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= 94 | github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= 95 | github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= 96 | github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= 97 | github.com/go-openapi/loads v0.17.2/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= 98 | github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= 99 | github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= 100 | github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= 101 | github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= 102 | github.com/go-openapi/runtime v0.18.0/go.mod h1:uI6pHuxWYTy94zZxgcwJkUWa9wbIlhteGfloI10GD4U= 103 | github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= 104 | github.com/go-openapi/runtime v0.19.3/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= 105 | github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= 106 | github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= 107 | github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= 108 | github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= 109 | github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= 110 | github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= 111 | github.com/go-openapi/strfmt v0.17.2/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= 112 | github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= 113 | github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= 114 | github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= 115 | github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= 116 | github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= 117 | github.com/go-openapi/swag v0.17.2/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= 118 | github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= 119 | github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= 120 | github.com/go-openapi/swag v0.19.4/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= 121 | github.com/go-openapi/validate v0.17.2/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= 122 | github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= 123 | github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= 124 | github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= 125 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 126 | github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 127 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 128 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= 129 | github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= 130 | github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48 h1:X+zN6RZXsvnrSJaAIQhZezPfAfvsqihKKR8oiLHid34= 131 | github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= 132 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= 133 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 134 | github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 135 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 136 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 137 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 138 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 139 | github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 140 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 141 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 142 | github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= 143 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 144 | github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= 145 | github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 146 | github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 147 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 148 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 149 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 150 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 151 | github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= 152 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 153 | github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= 154 | github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= 155 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 156 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 157 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 158 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 159 | github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 160 | github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 161 | github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 162 | github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 163 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 164 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 165 | github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= 166 | github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= 167 | github.com/googleapis/gnostic v0.3.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= 168 | github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= 169 | github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= 170 | github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= 171 | github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 172 | github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI= 173 | github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 174 | github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= 175 | github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= 176 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 177 | github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 178 | github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 179 | github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 180 | github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 181 | github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 182 | github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 183 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 184 | github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= 185 | github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= 186 | github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= 187 | github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= 188 | github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= 189 | github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= 190 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 191 | github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 192 | github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 193 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 194 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 195 | github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 196 | github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= 197 | github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= 198 | github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= 199 | github.com/hashicorp/memberlist v0.1.4/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= 200 | github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 201 | github.com/hashicorp/serf v0.8.3/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= 202 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 203 | github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= 204 | github.com/influxdata/influxdb v1.7.7/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= 205 | github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= 206 | github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= 207 | github.com/jessevdk/go-flags v0.0.0-20180331124232-1c38ed7ad0cc/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= 208 | github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= 209 | github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= 210 | github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= 211 | github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= 212 | github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 213 | github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 214 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 215 | github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 216 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 217 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 218 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= 219 | github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 220 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 221 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 222 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= 223 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 224 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 225 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 226 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 227 | github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= 228 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 229 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 230 | github.com/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= 231 | github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 h1:0iQektZGS248WXmGIYOwRXSQhD4qn3icjMpuxwO7qlo= 232 | github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE= 233 | github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f h1:sgUSP4zdTUZYZgAGGtN5Lxk92rK+JUFOwf+FT99EEI4= 234 | github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8= 235 | github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 h1:Bvq8AziQ5jFF4BHGAEDSqwPW1NJS3XshxbRCxtjFAZc= 236 | github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0= 237 | github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 238 | github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 239 | github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 240 | github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 241 | github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 242 | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 243 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 244 | github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= 245 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 246 | github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 247 | github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 248 | github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= 249 | github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 250 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 251 | github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= 252 | github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= 253 | github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= 254 | github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= 255 | github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 256 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 257 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 258 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 259 | github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 260 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 261 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 262 | github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= 263 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 264 | github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 265 | github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= 266 | github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= 267 | github.com/oklog/ulid v0.0.0-20170117200651-66bb6560562f/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 268 | github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 269 | github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 270 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 271 | github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 272 | github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= 273 | github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 274 | github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 275 | github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w= 276 | github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= 277 | github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 278 | github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 279 | github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= 280 | github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= 281 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 282 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 283 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 284 | github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 285 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 286 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 287 | github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= 288 | github.com/prometheus/alertmanager v0.18.0/go.mod h1:WcxHBl40VSPuOaqWae6l6HpnEOVRIycEJ7i9iYkadEE= 289 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 290 | github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= 291 | github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= 292 | github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= 293 | github.com/prometheus/client_golang v1.2.1 h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI= 294 | github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= 295 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 296 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 297 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= 298 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 299 | github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 300 | github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 301 | github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= 302 | github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= 303 | github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= 304 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 305 | github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 306 | github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 307 | github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= 308 | github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= 309 | github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= 310 | github.com/prometheus/prometheus v0.0.0-20180315085919-58e2a31db8de/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= 311 | github.com/prometheus/prometheus v1.8.2-0.20190818123050-43acd0e2e93f h1:aKNpi68IvDAt/yDNT0XiuSR15GImr2YKU6Nv4XHNhZI= 312 | github.com/prometheus/prometheus v1.8.2-0.20190818123050-43acd0e2e93f/go.mod h1:rMTlmxGCvukf2KMu3fClMDKLLoJ5hl61MhcJ7xKakf0= 313 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 314 | github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= 315 | github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 316 | github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 317 | github.com/samuel/go-zookeeper v0.0.0-20190810000440-0ceca61e4d75/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= 318 | github.com/satori/go.uuid v0.0.0-20160603004225-b111a074d5ef/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= 319 | github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 320 | github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= 321 | github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= 322 | github.com/shurcooL/vfsgen v0.0.0-20180825020608-02ddb050ef6b/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= 323 | github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= 324 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 325 | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 326 | github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= 327 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 328 | github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 329 | github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= 330 | github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 331 | github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 332 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 333 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 334 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 335 | github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= 336 | github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 337 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 338 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 339 | github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= 340 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 341 | github.com/tebeka/strftime v0.0.0-20140926081919-3f9c7761e312 h1:frNEkk4P8mq+47LAMvj9LvhDq01kFDUhpJZzzei8IuM= 342 | github.com/tebeka/strftime v0.0.0-20140926081919-3f9c7761e312/go.mod h1:o6CrSUtupq/A5hylbvAsdydn0d5yokJExs8VVdx4wwI= 343 | github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= 344 | github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= 345 | github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= 346 | go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= 347 | go.mongodb.org/mongo-driver v1.0.4/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= 348 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 349 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 350 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 351 | golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 352 | golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 353 | golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 354 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 355 | golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 356 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 357 | golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 358 | golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 359 | golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 360 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 361 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 362 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 363 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 364 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 365 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 366 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 367 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 368 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 369 | golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 370 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 371 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 372 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 373 | golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 374 | golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 375 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 376 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 377 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 378 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 379 | golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 380 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 381 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 382 | golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 383 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 384 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 385 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 386 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 387 | golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 388 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 389 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 390 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk= 391 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 392 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 393 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 394 | golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 395 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 396 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 397 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 398 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 399 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 400 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 401 | golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 402 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 403 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 404 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 405 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 406 | golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 407 | golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 408 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 409 | golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 410 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 411 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 412 | golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 413 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 414 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 415 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 416 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 417 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 418 | golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 419 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 420 | golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 421 | golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 422 | golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 423 | golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= 424 | golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 425 | golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 426 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 427 | golang.org/x/text v0.3.1-0.20180805044716-cb6730876b98/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 428 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 429 | golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 430 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= 431 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 432 | golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 433 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 434 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 435 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 436 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 437 | golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 438 | golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 439 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 440 | golang.org/x/tools v0.0.0-20190118193359-16909d206f00/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 441 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 442 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 443 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 444 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 445 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 446 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 447 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 448 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 449 | golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 450 | golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 451 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 452 | golang.org/x/tools v0.0.0-20190813034749-528a2984e271/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 453 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 454 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 455 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 456 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 457 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 458 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 459 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 460 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 461 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 462 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 463 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 464 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 465 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 466 | google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 467 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 h1:iKtrH9Y8mcbADOP0YFaEMth7OfuHY9xHOwNj4znpM1A= 468 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 469 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 470 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 471 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 472 | google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 473 | google.golang.org/grpc v1.22.1 h1:/7cs52RnTJmD43s3uxzlq2U7nqVTd/37viQwMrMNlOM= 474 | google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 475 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 476 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 477 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 478 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 479 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 480 | gopkg.in/fsnotify/fsnotify.v1 v1.4.7/go.mod h1:Fyux9zXlo4rWoMSIzpn9fDAYjalPqJ/K1qJ27s+7ltE= 481 | gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= 482 | gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= 483 | gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 484 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 485 | gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 486 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 487 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 488 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 489 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 490 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 491 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 492 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 493 | k8s.io/api v0.0.0-20190620084959-7cf5895f2711/go.mod h1:TBhBqb1AWbBQbW3XRusr7n7E4v2+5ZY8r8sAMnyFC5A= 494 | k8s.io/api v0.0.0-20190813020757-36bff7324fb7/go.mod h1:3Iy+myeAORNCLgjd/Xu9ebwN7Vh59Bw0vh9jhoX+V58= 495 | k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719/go.mod h1:I4A+glKBHiTgiEjQiCCQfCAIcIMFGt291SmsvcrFzJA= 496 | k8s.io/apimachinery v0.0.0-20190809020650-423f5d784010/go.mod h1:Waf/xTS2FGRrgXCkO5FP3XxTOWh0qLf2QhL1qFZZ/R8= 497 | k8s.io/client-go v0.0.0-20190620085101-78d2af792bab/go.mod h1:E95RaSlHr79aHaX0aGSwcPNfygDiPKOVXdmivCIZT0k= 498 | k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= 499 | k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 500 | k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 501 | k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 502 | k8s.io/klog v0.4.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= 503 | k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= 504 | k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058/go.mod h1:nfDlWeOsu3pUf4yWGL+ERqohP4YsZcBJXWMK+gkzOA4= 505 | k8s.io/kube-openapi v0.0.0-20190722073852-5e22f3d471e6/go.mod h1:RZvgC8MSN6DjiMV6oIfEE9pDL9CYXokkfaCKZeHm3nc= 506 | k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= 507 | k8s.io/utils v0.0.0-20190809000727-6c36bc71fc4a/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= 508 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 509 | sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= 510 | sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= 511 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "io/ioutil" 6 | "net/http" 7 | "os" 8 | "path" 9 | "time" 10 | 11 | "github.com/go-kit/kit/log" 12 | "github.com/go-kit/kit/log/level" 13 | "github.com/golang/protobuf/proto" 14 | "github.com/golang/snappy" 15 | "github.com/kebe7jun/ropee/metrics" 16 | "github.com/kebe7jun/ropee/storage" 17 | "github.com/lestrrat/go-file-rotatelogs" 18 | "github.com/prometheus/client_golang/prometheus/promhttp" 19 | "github.com/prometheus/prometheus/prompb" 20 | ) 21 | 22 | type Config struct { 23 | SplunkUrl string 24 | SplunkMetricsIndex string 25 | SplunkMetricsSourceType string 26 | SplunkHECURL string 27 | SplunkHECToken string 28 | TimeoutSeconds int 29 | ListenAddr string 30 | LogFilePath string 31 | Debug bool 32 | } 33 | 34 | var config Config 35 | 36 | func loadRotateWriter(logPath, fileName string) *rotatelogs.RotateLogs { 37 | writer, _ := rotatelogs.New( 38 | path.Join(logPath, fileName)+".%Y%m%d%H%M", 39 | rotatelogs.WithLinkName(path.Join(logPath, fileName)), // 生成软链,指向最新日志文件 40 | rotatelogs.WithMaxAge(7*24*time.Hour), // 文件最大保存时间 41 | rotatelogs.WithRotationTime(48*time.Hour), // 日志切割时间间隔 42 | ) 43 | return writer 44 | } 45 | 46 | func loadLogger() log.Logger { 47 | var logger log.Logger 48 | if config.LogFilePath == "-" { 49 | logger = log.NewLogfmtLogger(os.Stdout) 50 | } else { 51 | logger = log.NewLogfmtLogger(log.NewSyncWriter(loadRotateWriter(config.LogFilePath, "ropee.log"))) 52 | } 53 | 54 | if config.Debug { 55 | logger = level.NewFilter(logger, level.AllowDebug()) 56 | } else { 57 | logger = level.NewFilter(logger, level.AllowInfo()) 58 | } 59 | logger = log.With(logger, "time", log.DefaultTimestampUTC, "caller", log.DefaultCaller) 60 | return logger 61 | } 62 | 63 | func initConfig() { 64 | // init config 65 | flag.StringVar(&config.SplunkUrl, "splunk-url", "https://127.0.0.1:8089", "Splunk Manage Url.") 66 | flag.StringVar(&config.SplunkHECURL, "splunk-hec-url", "https://127.0.0.1:8088", "Splunk Http event collector url.") 67 | flag.StringVar(&config.SplunkHECToken, "splunk-hec-token", "", "Splunk Http event collector token.") 68 | flag.StringVar(&config.ListenAddr, "listen-addr", "127.0.0.1:9970", "Sopee listen addr.") 69 | flag.StringVar(&config.SplunkMetricsIndex, "splunk-metrics-index", "*", "Index name.") 70 | flag.StringVar(&config.SplunkMetricsSourceType, "splunk-metrics-sourcetype", "DaoCloud_promu_metrics", "The prometheus sourcetype name.") 71 | flag.StringVar(&config.LogFilePath, "log-file-path", "/var/log", "Log files path.") 72 | flag.IntVar(&config.TimeoutSeconds, "timeout", 60, "API timeout seconds.") 73 | flag.BoolVar(&config.Debug, "debug", false, "Debug mode.") 74 | flag.Parse() 75 | } 76 | 77 | func main() { 78 | initConfig() 79 | l := loadLogger() 80 | http.Handle("/metrics", promhttp.Handler()) 81 | http.HandleFunc("/read", func(w http.ResponseWriter, r *http.Request) { 82 | compressed, err := ioutil.ReadAll(r.Body) 83 | if err != nil { 84 | level.Error(l).Log("msg", "Read error", "err", err.Error()) 85 | http.Error(w, err.Error(), http.StatusInternalServerError) 86 | return 87 | } 88 | 89 | reqBuf, err := snappy.Decode(nil, compressed) 90 | if err != nil { 91 | level.Error(l).Log("msg", "Decode error", "err", err.Error()) 92 | http.Error(w, err.Error(), http.StatusBadRequest) 93 | return 94 | } 95 | metrics.ReadRequestCounter.Add(1) 96 | var req prompb.ReadRequest 97 | if err := proto.Unmarshal(reqBuf, &req); err != nil { 98 | level.Error(l).Log("msg", "Unmarshal error", "err", err.Error()) 99 | http.Error(w, err.Error(), http.StatusBadRequest) 100 | return 101 | } 102 | user, pass, _ := r.BasicAuth() 103 | readClient, _ := storage.NewClient( 104 | config.SplunkUrl, 105 | user, 106 | pass, 107 | config.SplunkMetricsIndex, 108 | config.SplunkMetricsSourceType, 109 | config.SplunkHECURL, config.SplunkHECToken, 110 | time.Second*time.Duration(config.TimeoutSeconds), 111 | l, 112 | ) 113 | resp, err := readClient.Read(&req) 114 | if err != nil { 115 | http.Error(w, err.Error(), http.StatusInternalServerError) 116 | return 117 | } 118 | 119 | data, err := proto.Marshal(resp) 120 | if err != nil { 121 | http.Error(w, err.Error(), http.StatusInternalServerError) 122 | return 123 | } 124 | 125 | w.Header().Set("Content-Type", "application/x-protobuf") 126 | w.Header().Set("Content-Encoding", "snappy") 127 | 128 | compressed = snappy.Encode(nil, data) 129 | if _, err := w.Write(compressed); err != nil { 130 | level.Warn(l).Log("msg", "Error executing query", "query", req, "err", err) 131 | http.Error(w, err.Error(), http.StatusInternalServerError) 132 | return 133 | } 134 | }) 135 | writeClient, _ := storage.NewClient( 136 | config.SplunkUrl, 137 | "", 138 | "", 139 | config.SplunkMetricsIndex, 140 | config.SplunkMetricsSourceType, 141 | config.SplunkHECURL, config.SplunkHECToken, 142 | time.Second*time.Duration(config.TimeoutSeconds), 143 | l, 144 | ) 145 | http.HandleFunc("/write", func(w http.ResponseWriter, r *http.Request) { 146 | compressed, err := ioutil.ReadAll(r.Body) 147 | if err != nil { 148 | level.Error(l).Log("msg", "Read error", "err", err.Error()) 149 | http.Error(w, err.Error(), http.StatusInternalServerError) 150 | return 151 | } 152 | 153 | reqBuf, err := snappy.Decode(nil, compressed) 154 | if err != nil { 155 | level.Error(l).Log("msg", "Decode error", "err", err.Error()) 156 | http.Error(w, err.Error(), http.StatusBadRequest) 157 | return 158 | } 159 | metrics.WriteRequestCounter.Add(1) 160 | var req prompb.WriteRequest 161 | if err := proto.Unmarshal(reqBuf, &req); err != nil { 162 | level.Error(l).Log("msg", "Unmarshal error", "err", err.Error()) 163 | http.Error(w, err.Error(), http.StatusBadRequest) 164 | return 165 | } 166 | err = writeClient.Write(&req) 167 | if err != nil { 168 | http.Error(w, err.Error(), http.StatusInternalServerError) 169 | return 170 | } 171 | w.WriteHeader(200) 172 | if _, err := w.Write([]byte("ok")); err != nil { 173 | level.Error(l).Log("action", "write", "err", err) 174 | } 175 | }) 176 | level.Info(l).Log("msg", "starting server...", "listen", config.ListenAddr) 177 | if err := http.ListenAndServe(config.ListenAddr, nil); err != nil { 178 | level.Error(l).Log("action", "serve", "err", err) 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /metrics/metrics.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "github.com/prometheus/client_golang/prometheus" 5 | ) 6 | 7 | var ( 8 | WriteRequestCounter = prometheus.NewCounter( 9 | prometheus.CounterOpts{ 10 | Name: "ropee_write_request_count", 11 | }, 12 | ) 13 | ReadRequestCounter = prometheus.NewCounter( 14 | prometheus.CounterOpts{ 15 | Name: "ropee_read_request_count", 16 | }, 17 | ) 18 | SplunkJobLatency = prometheus.NewHistogram(prometheus.HistogramOpts{ 19 | Name: "ropee_splunk_job_latency", 20 | Buckets: prometheus.LinearBuckets(0.1, .5, 5), 21 | }) 22 | SplunkEventsWrote = prometheus.NewCounter( 23 | prometheus.CounterOpts{ 24 | Name: "ropee_splunk_events_wrote_count", 25 | }, 26 | ) 27 | SplunkEventsWroteFailed = prometheus.NewCounter( 28 | prometheus.CounterOpts{ 29 | Name: "ropee_splunk_events_wrote_failed_count", 30 | }, 31 | ) 32 | uptime = prometheus.NewGauge(prometheus.GaugeOpts{ 33 | Name: "ropee_uptime", 34 | }) 35 | ) 36 | 37 | func init() { 38 | prometheus.MustRegister(WriteRequestCounter) 39 | prometheus.MustRegister(ReadRequestCounter) 40 | prometheus.MustRegister(SplunkJobLatency) 41 | prometheus.MustRegister(SplunkEventsWrote) 42 | prometheus.MustRegister(SplunkEventsWroteFailed) 43 | prometheus.MustRegister(uptime) 44 | uptime.SetToCurrentTime() 45 | } 46 | -------------------------------------------------------------------------------- /storage/client.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "crypto/tls" 7 | "encoding/json" 8 | "fmt" 9 | "io" 10 | "io/ioutil" 11 | "net/http" 12 | "net/url" 13 | "path" 14 | "strconv" 15 | "strings" 16 | "time" 17 | 18 | "github.com/go-kit/kit/log" 19 | "github.com/go-kit/kit/log/level" 20 | "github.com/kebe7jun/ropee/metrics" 21 | "github.com/prometheus/prometheus/prompb" 22 | ) 23 | 24 | type RemoteClient interface { 25 | Read(*prompb.ReadRequest) (*prompb.ReadResponse, error) 26 | Write(*prompb.WriteRequest) error 27 | MetricLabels(string) []string 28 | LabelValues(string) []string 29 | } 30 | 31 | type HTTPClient interface { 32 | Do(req *http.Request) (*http.Response, error) 33 | } 34 | 35 | type Client struct { 36 | url string 37 | user string 38 | password string 39 | client HTTPClient 40 | timeout time.Duration 41 | index string 42 | hecUrl, hecToken string 43 | sourcetype string 44 | log log.Logger 45 | } 46 | 47 | func NewClient( 48 | url, user, password, 49 | index, sourcetype string, 50 | hecUrl, hecToken string, 51 | timeout time.Duration, log log.Logger) (RemoteClient, error) { 52 | transCfg := &http.Transport{ 53 | TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // ignore expired SSL certificates 54 | } 55 | return &Client{ 56 | url: url, 57 | user: user, 58 | password: password, 59 | client: &http.Client{Transport: transCfg}, 60 | timeout: timeout, 61 | index: index, 62 | hecUrl: hecUrl, 63 | hecToken: hecToken, 64 | sourcetype: sourcetype, 65 | log: log, 66 | }, nil 67 | } 68 | 69 | type jobResultPreview struct { 70 | Fields []string `json:"fields"` 71 | Rows [][]string `json:"rows"` 72 | } 73 | 74 | func (c *Client) Write(req *prompb.WriteRequest) error { 75 | events := make([]SplunkMetricEvent, 0) 76 | for _, series := range req.Timeseries { 77 | es := TimeSeriesToPromMetrics(series) 78 | events = append(events, es...) 79 | // todo slice events 80 | } 81 | err := c.splunkHECEvents(events) 82 | if err != nil { 83 | metrics.SplunkEventsWroteFailed.Add(float64(len(events))) 84 | return err 85 | } 86 | metrics.SplunkEventsWrote.Add(float64(len(events))) 87 | return nil 88 | } 89 | 90 | func (c *Client) Read(req *prompb.ReadRequest) (*prompb.ReadResponse, error) { 91 | queryResults := make([]*prompb.QueryResult, 0) 92 | for _, q := range req.Queries { 93 | search, err := MakeSPL(q, c, c.index) 94 | if err != nil { 95 | level.Error(c.log).Log("msg", err) 96 | return nil, err 97 | } 98 | level.Debug(c.log).Log("rendered_search", search, "earliest", q.StartTimestampMs, "latest", q.EndTimestampMs) 99 | timeStarted := time.Now() 100 | res, err := c.runSearchWithResult(search, q.StartTimestampMs, q.EndTimestampMs) 101 | if err != nil { 102 | level.Error(c.log).Log("msg", err) 103 | return nil, err 104 | } 105 | metrics.SplunkJobLatency.Observe(float64(time.Now().Sub(timeStarted) / time.Second)) 106 | var resPreview jobResultPreview 107 | json.Unmarshal(res, &resPreview) 108 | if len(resPreview.Fields) == 0 { 109 | break 110 | } 111 | keysMap := make(map[string]*prompb.TimeSeries) 112 | 113 | for _, values := range resPreview.Rows { 114 | var labelValueList []string 115 | key := "" 116 | l := make([]prompb.Label, 0) 117 | var t time.Time 118 | var value float64 119 | for i, v := range values { 120 | k := resPreview.Fields[i] 121 | if k == CommonMetricName { 122 | k = "__name__" 123 | } 124 | if k == "_time" { 125 | t, _ = time.Parse(time.RFC3339, v) 126 | continue 127 | } 128 | if k == CommonMetricValue { 129 | value, _ = strconv.ParseFloat(v, 64) 130 | continue 131 | } 132 | l = append(l, prompb.Label{ 133 | Name: k, 134 | Value: v, 135 | }) 136 | labelValueList = append(labelValueList, v) 137 | } 138 | key = strings.Join(labelValueList, ",") 139 | if _, ok := keysMap[key]; !ok { 140 | tv := make([]prompb.Sample, 0) 141 | tv = append(tv, prompb.Sample{Timestamp: t.Unix() * 1000, Value: value}) 142 | keysMap[key] = &prompb.TimeSeries{ 143 | Labels: l, 144 | Samples: tv, 145 | } 146 | } else { 147 | s := keysMap[key] 148 | s.Samples = append(keysMap[key].Samples, prompb.Sample{Timestamp: t.Unix() * 1000, Value: value}) 149 | keysMap[key] = s 150 | } 151 | } 152 | timeSeries := make([]*prompb.TimeSeries, 0) 153 | for _, value := range keysMap { 154 | timeSeries = append(timeSeries, value) 155 | } 156 | queryResults = append(queryResults, &prompb.QueryResult{ 157 | Timeseries: timeSeries, 158 | }) 159 | } 160 | return &prompb.ReadResponse{ 161 | Results: queryResults, 162 | }, nil 163 | } 164 | 165 | func urlJoin(baseUrl, reqPath string) (string, error) { 166 | u, err := url.Parse(baseUrl) 167 | if err != nil { 168 | return "", err 169 | } 170 | u.Path = path.Join(u.Path, reqPath) 171 | return u.String(), nil 172 | } 173 | 174 | func (c *Client) splunkHECEvents(events []SplunkMetricEvent) error { 175 | var buffer bytes.Buffer 176 | var reqUrl string 177 | if _url, err := urlJoin(c.hecUrl, "/services/collector"); err == nil { 178 | reqUrl = _url 179 | } else { 180 | return err 181 | } 182 | for _, event := range events { 183 | e, _ := json.Marshal(map[string]string{ 184 | "index": c.index, 185 | "sourcetype": c.sourcetype, 186 | "time": strconv.FormatFloat(float64(event.Time)/1000.0, 'f', -1, 64), 187 | "event": event.MetricStr, 188 | "source": "ropee-client/1.0", 189 | }) 190 | buffer.Write(e) 191 | } 192 | httpReq, err := http.NewRequest("POST", reqUrl, strings.NewReader(buffer.String())) 193 | if err != nil { 194 | level.Error(c.log).Log("type", "hec-events", "err", err) 195 | } 196 | httpReq.Header.Set("User-Agent", "ropee client/1.0") 197 | httpReq.SetBasicAuth("x", c.hecToken) 198 | 199 | ctx := context.Background() 200 | 201 | ctx, cancel := context.WithTimeout(ctx, c.timeout) 202 | defer cancel() 203 | 204 | httpResp, err := c.client.Do(httpReq.WithContext(ctx)) 205 | if err != nil { 206 | return err 207 | } 208 | if httpResp.StatusCode >= 400 { 209 | level.Warn(c.log).Log("type", "hec-events-resp", "status", httpResp.StatusCode) 210 | } 211 | return nil 212 | } 213 | 214 | func (c *Client) splunkRESTRequest(method, reqPath string, params, body map[string]string) ([]byte, error) { 215 | var b io.Reader = nil 216 | if body != nil { 217 | p := url.Values{} 218 | for k, v := range body { 219 | p.Add(k, v) 220 | } 221 | b = strings.NewReader(p.Encode()) 222 | } 223 | var reqUrl string 224 | if _url, err := urlJoin(c.url, reqPath); err == nil { 225 | reqUrl = _url 226 | } else { 227 | return nil, err 228 | } 229 | httpReq, err := http.NewRequest(method, reqUrl, b) 230 | httpReq.SetBasicAuth(c.user, c.password) 231 | q := httpReq.URL.Query() 232 | if _, ok := params["output_mode"]; !ok { 233 | q.Add("output_mode", "json") 234 | } 235 | q.Add("count", "50000") 236 | for k, v := range params { 237 | q.Add(k, v) 238 | } 239 | httpReq.URL.RawQuery = q.Encode() 240 | httpReq.Header.Set("User-Agent", "ropee client/1.0") 241 | 242 | ctx := context.Background() 243 | 244 | ctx, cancel := context.WithTimeout(ctx, c.timeout) 245 | defer cancel() 246 | 247 | httpResp, err := c.client.Do(httpReq.WithContext(ctx)) 248 | if err != nil { 249 | return nil, err 250 | } 251 | defer httpResp.Body.Close() 252 | return ioutil.ReadAll(httpResp.Body) 253 | } 254 | 255 | type Metric struct { 256 | Name string `json:"name"` 257 | } 258 | 259 | type MetricLabel struct { 260 | Name string `json:"name"` 261 | } 262 | 263 | type LabelValue struct { 264 | Name string `json:"name"` 265 | } 266 | 267 | func (c *Client) GetMetrics() []string { 268 | var params = map[string]string{ 269 | "filter": "index=" + c.index, 270 | } 271 | 272 | res, _ := c.splunkRESTRequest("GET", "/services/catalog/metricstore/metrics", params, nil) 273 | var result map[string][]Metric 274 | json.Unmarshal(res, &result) 275 | ls := make([]string, 0) 276 | for l := 0; l < len(result["entry"]); l++ { 277 | ls = append(ls, result["entry"][l].Name) 278 | } 279 | return ls 280 | } 281 | 282 | func (c *Client) MetricLabels(metricName string) []string { 283 | var params = map[string]string{ 284 | "filter": "index=" + c.index, 285 | "metric_name": metricName, 286 | } 287 | 288 | res, _ := c.splunkRESTRequest("GET", "/services/catalog/metricstore/dimensions", params, nil) 289 | var result map[string][]MetricLabel 290 | json.Unmarshal(res, &result) 291 | ls := make([]string, 0) 292 | for l := 0; l < len(result["entry"]); l++ { 293 | if result["entry"][l].Name == "source" || result["entry"][l].Name == "sourcetype" { 294 | continue 295 | } 296 | ls = append(ls, result["entry"][l].Name) 297 | } 298 | return ls 299 | } 300 | 301 | func (c *Client) LabelValues(labelName string) []string { 302 | if labelName == "__name__" { 303 | return c.GetMetrics() 304 | } 305 | var params = map[string]string{ 306 | "filter": "index=" + c.index, 307 | "metric_name": "*", 308 | } 309 | 310 | res, _ := c.splunkRESTRequest("GET", 311 | "/services/catalog/metricstore/dimensions/"+labelName+"/values", params, nil) 312 | var result map[string][]LabelValue 313 | json.Unmarshal(res, &result) 314 | ls := make([]string, 0) 315 | for l := 0; l < len(result["entry"]); l++ { 316 | ls = append(ls, result["entry"][l].Name) 317 | } 318 | return ls 319 | } 320 | 321 | func (c *Client) runSearchWithResult(search string, start, end int64) ([]byte, error) { 322 | body := map[string]string{ 323 | "search": search, 324 | "latest_time": strconv.FormatInt(int64(end)/1000, 10), 325 | "earliest_time": strconv.FormatInt(int64(start)/1000, 10), 326 | } 327 | var result map[string]string 328 | res, err := c.splunkRESTRequest("POST", "/services/search/jobs", nil, body) 329 | if err != nil { 330 | return nil, err 331 | } 332 | json.Unmarshal(res, &result) 333 | sid := result["sid"] 334 | for { 335 | time.Sleep(100 * time.Millisecond) 336 | var jobResult map[string][]map[string]map[string]bool 337 | res, _ := c.splunkRESTRequest("GET", "/services/search/jobs/"+sid, nil, body) 338 | 339 | json.Unmarshal(res, &jobResult) 340 | jobs := jobResult["entry"] 341 | if len(jobs) < 1 { 342 | return nil, fmt.Errorf("get job error") 343 | } 344 | if jobs[0]["content"]["isDone"] { 345 | break 346 | } 347 | } 348 | return c.splunkRESTRequest( 349 | "GET", 350 | "/servicesNS/nobody/-/search/jobs/"+sid+"/results_preview", 351 | map[string]string{ 352 | "output_mode": "json_rows", 353 | }, 354 | nil, 355 | ) 356 | } 357 | -------------------------------------------------------------------------------- /storage/client_test.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "io/ioutil" 7 | "net/http" 8 | "testing" 9 | 10 | "github.com/kebe7jun/ropee/test" 11 | "github.com/prometheus/prometheus/prompb" 12 | ) 13 | 14 | type fakeClient struct { 15 | expectBody string 16 | status int 17 | body string 18 | } 19 | 20 | func (f *fakeClient) Do(req *http.Request) (*http.Response, error) { 21 | if req.Body != nil { 22 | bs, err := ioutil.ReadAll(req.Body) 23 | if err != nil { 24 | return nil, err 25 | } 26 | if f.expectBody != "" && string(bs) != f.expectBody { 27 | return nil, fmt.Errorf("req expect error, body: %s, want: %s", bs, f.expectBody) 28 | } 29 | } 30 | return &http.Response{ 31 | StatusCode: f.status, 32 | Body: test.NewBody(f.body), 33 | }, nil 34 | } 35 | 36 | func TestClient_Write(t *testing.T) { 37 | cases := []struct { 38 | name string 39 | events prompb.WriteRequest 40 | wannaBody string 41 | }{ 42 | { 43 | "normal events", 44 | prompb.WriteRequest{ 45 | Timeseries: []prompb.TimeSeries{ 46 | { 47 | Labels: []prompb.Label{ 48 | { 49 | Name: "__name__", 50 | Value: "test", 51 | }, 52 | { 53 | Name: "test", 54 | Value: "1", 55 | }, 56 | }, 57 | Samples: []prompb.Sample{ 58 | { 59 | Value: 1, 60 | Timestamp: 1, 61 | }, 62 | }, 63 | }, 64 | }, 65 | }, 66 | `{"event":"test{test=\"1\"} 1","index":"","source":"ropee-client/1.0","sourcetype":"","time":"0.001"}`, 67 | }, 68 | { 69 | "multi events", 70 | prompb.WriteRequest{ 71 | Timeseries: []prompb.TimeSeries{ 72 | { 73 | Labels: []prompb.Label{ 74 | { 75 | Name: "__name__", 76 | Value: "test", 77 | }, 78 | { 79 | Name: "test", 80 | Value: "1", 81 | }, 82 | }, 83 | Samples: []prompb.Sample{ 84 | { 85 | Value: 1, 86 | Timestamp: 1, 87 | }, 88 | { 89 | Value: 2, 90 | Timestamp: 2, 91 | }, 92 | }, 93 | }, 94 | }, 95 | }, 96 | `{"event":"test{test=\"1\"} 1","index":"","source":"ropee-client/1.0","sourcetype":"","time":"0.001"}{"event":"test{test=\"1\"} 2","index":"","source":"ropee-client/1.0","sourcetype":"","time":"0.002"}`, 97 | }, 98 | } 99 | for i, c := range cases { 100 | t.Run(fmt.Sprintf("test-%d-%s", i, c.name), func(t *testing.T) { 101 | client := Client{ 102 | url: "http://test.com", 103 | client: &fakeClient{ 104 | expectBody: c.wannaBody, 105 | status: 200, 106 | }, 107 | } 108 | err := client.Write(&c.events) 109 | if err != nil { 110 | t.Fatal(err) 111 | } 112 | }) 113 | } 114 | } 115 | 116 | type fakeReadClient struct { 117 | status int 118 | bodyChan chan string 119 | } 120 | 121 | func (f *fakeReadClient) Do(req *http.Request) (*http.Response, error) { 122 | return &http.Response{ 123 | StatusCode: f.status, 124 | Body: test.NewBody(<-f.bodyChan), 125 | }, nil 126 | } 127 | 128 | func TestClient_Read(t *testing.T) { 129 | cases := []struct { 130 | name string 131 | req prompb.ReadRequest 132 | splunkRes string 133 | bodys []string 134 | wannaRes string 135 | }{ 136 | { 137 | "normal read", 138 | prompb.ReadRequest{ 139 | Queries: []*prompb.Query{ 140 | { 141 | StartTimestampMs: 0, 142 | EndTimestampMs: 10, 143 | Matchers: []*prompb.LabelMatcher{ 144 | { 145 | Type: prompb.LabelMatcher_EQ, 146 | Name: "__name__", 147 | Value: "test", 148 | }, 149 | }, 150 | Hints: &prompb.ReadHints{ 151 | StepMs: 0, 152 | }, 153 | }, 154 | }, 155 | }, 156 | `{}`, 157 | []string{ 158 | "[]", 159 | `{"sid":"1"}`, 160 | `{"sid":"1","entry":[{"content":{"isDone":true}}]}`, 161 | `{"fields":["ropee_metric_name","ropee_metric_value","_time"],"rows":[["test","test","1970-01-01T00:00:01Z"]]}`, 162 | }, 163 | `{"results":[{"timeseries":[{"labels":[{"name":"__name__","value":"test"}],"samples":[{"timestamp":1000}]}]}]}`, 164 | }, 165 | } 166 | for i, c := range cases { 167 | t.Run(fmt.Sprintf("test-%d-%s", i, c.name), func(t *testing.T) { 168 | bodyChan := make(chan string, len(c.bodys)) 169 | for _, s := range c.bodys { 170 | bodyChan <- s 171 | } 172 | client := Client{ 173 | url: "http://test.com", 174 | client: &fakeReadClient{ 175 | status: 200, 176 | bodyChan: bodyChan, 177 | }, 178 | log: test.Logger(), 179 | } 180 | res, err := client.Read(&c.req) 181 | if err != nil { 182 | t.Fatal(err) 183 | } 184 | resb, err := json.Marshal(res) 185 | if string(resb) != c.wannaRes { 186 | t.Fatalf("unexpected res: %s, want: %s", resb, c.wannaRes) 187 | } 188 | }) 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /storage/constants.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | const ( 4 | CommonMetricName = "ropee_metric_name" 5 | CommonMetricValue = "ropee_metric_value" 6 | ) 7 | -------------------------------------------------------------------------------- /storage/spl_engine.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | "strings" 7 | 8 | "github.com/prometheus/prometheus/prompb" 9 | ) 10 | 11 | func MakeSPL(query *prompb.Query, c RemoteClient, index string) (string, error) { 12 | metricName := "" 13 | for _, m := range query.Matchers { 14 | if m.Name == "__name__" { 15 | if m.Type != prompb.LabelMatcher_EQ { 16 | return "", fmt.Errorf("metric_name label macher type error, only euqals supported") 17 | } 18 | metricName = m.Value 19 | break 20 | } 21 | } 22 | if metricName == "" { 23 | return "", fmt.Errorf("__name__ is required") 24 | } 25 | step := query.Hints.StepMs / 1000 26 | if step < 10 { 27 | step = 10 28 | } 29 | ls := strings.Join(c.MetricLabels(metricName), " ") 30 | search := fmt.Sprintf("| mstats latest(_value) as %s where index=%s AND metric_name=%s span=%ds by metric_name %s", 31 | CommonMetricValue, index, metricName, step, ls) 32 | for _, m := range query.Matchers { 33 | if m.Name == "__name__" { 34 | continue 35 | } 36 | switch m.Type { 37 | case prompb.LabelMatcher_RE: 38 | //search += fmt.Sprintf("| regex " + m.Name + "=" + strconv.Quote(m.Value)) 39 | search += fmt.Sprintf("| regex %s=%q", m.Name, m.Value) 40 | case prompb.LabelMatcher_NRE: 41 | search += fmt.Sprintf("| regex %s!=%q", m.Name, m.Value) 42 | case prompb.LabelMatcher_EQ: 43 | search += fmt.Sprintf("| where %s=%q", m.Name, m.Value) 44 | case prompb.LabelMatcher_NEQ: 45 | search += fmt.Sprintf("| where %s!=%q", m.Name, m.Value) 46 | } 47 | } 48 | search += "| rename metric_name as " + CommonMetricName 49 | return search, nil 50 | } 51 | 52 | type SplunkMetricEvent struct { 53 | Time int64 54 | MetricStr string 55 | } 56 | 57 | func TimeSeriesToPromMetrics(series prompb.TimeSeries) []SplunkMetricEvent { 58 | res := make([]SplunkMetricEvent, 0, len(series.Samples)) 59 | labels := []string{} 60 | metricName := "" 61 | for _, label := range series.Labels { 62 | if label.Name == "__name__" { 63 | metricName = label.Value 64 | continue 65 | } 66 | labels = append(labels, label.Name+"="+strconv.Quote(label.Value)) 67 | } 68 | if metricName == "" { 69 | return nil 70 | } 71 | mergedKey := fmt.Sprintf("%s{%s}", metricName, strings.Join(labels, ",")) 72 | for _, sample := range series.Samples { 73 | valueTime := strconv.FormatFloat(sample.Value, 'f', -1, 64) 74 | res = append(res, SplunkMetricEvent{ 75 | Time: sample.Timestamp, 76 | MetricStr: fmt.Sprintf("%s %s", mergedKey, valueTime), 77 | }) 78 | } 79 | return res 80 | } 81 | -------------------------------------------------------------------------------- /storage/spl_engine_test.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/prometheus/prometheus/prompb" 8 | ) 9 | 10 | type rClient struct { 11 | RemoteClient 12 | labels []string 13 | } 14 | 15 | func (c *rClient) MetricLabels(string) []string { 16 | return c.labels 17 | } 18 | 19 | func TestMakeSPL(t *testing.T) { 20 | cases := []struct { 21 | name string 22 | q prompb.Query 23 | cli rClient 24 | index string 25 | wannaRes string 26 | wannaErr error 27 | }{ 28 | { 29 | "metric equals", 30 | prompb.Query{ 31 | StartTimestampMs: 0, 32 | EndTimestampMs: 10, 33 | Matchers: []*prompb.LabelMatcher{ 34 | { 35 | Type: prompb.LabelMatcher_EQ, 36 | Name: "__name__", 37 | Value: "test", 38 | }, 39 | }, 40 | Hints: &prompb.ReadHints{ 41 | StepMs: 0, 42 | }, 43 | }, 44 | rClient{ 45 | labels: []string{"test"}, 46 | }, 47 | "test", 48 | `| mstats latest(_value) as ropee_metric_value where index=test AND metric_name=test span=10s by metric_name test| rename metric_name as ropee_metric_name`, 49 | nil, 50 | }, 51 | { 52 | "step ms 100000", 53 | prompb.Query{ 54 | StartTimestampMs: 0, 55 | EndTimestampMs: 10, 56 | Matchers: []*prompb.LabelMatcher{ 57 | { 58 | Type: prompb.LabelMatcher_EQ, 59 | Name: "__name__", 60 | Value: "test", 61 | }, 62 | }, 63 | Hints: &prompb.ReadHints{ 64 | StepMs: 100000, 65 | }, 66 | }, 67 | rClient{ 68 | labels: []string{"test"}, 69 | }, 70 | "test", 71 | `| mstats latest(_value) as ropee_metric_value where index=test AND metric_name=test span=100s by metric_name test| rename metric_name as ropee_metric_name`, 72 | nil, 73 | }, 74 | { 75 | "multi labels", 76 | prompb.Query{ 77 | StartTimestampMs: 0, 78 | EndTimestampMs: 10, 79 | Matchers: []*prompb.LabelMatcher{ 80 | { 81 | Type: prompb.LabelMatcher_EQ, 82 | Name: "__name__", 83 | Value: "test", 84 | }, 85 | }, 86 | Hints: &prompb.ReadHints{ 87 | StepMs: 0, 88 | }, 89 | }, 90 | rClient{ 91 | labels: []string{"test", "q"}, 92 | }, 93 | "test", 94 | `| mstats latest(_value) as ropee_metric_value where index=test AND metric_name=test span=10s by metric_name test q| rename metric_name as ropee_metric_name`, 95 | nil, 96 | }, 97 | { 98 | "multi types", 99 | prompb.Query{ 100 | StartTimestampMs: 0, 101 | EndTimestampMs: 10, 102 | Matchers: []*prompb.LabelMatcher{ 103 | { 104 | Type: prompb.LabelMatcher_EQ, 105 | Name: "__name__", 106 | Value: "test", 107 | }, 108 | { 109 | Type: prompb.LabelMatcher_NEQ, 110 | Name: "test1", 111 | Value: "test", 112 | }, 113 | { 114 | Type: prompb.LabelMatcher_RE, 115 | Name: "test2", 116 | Value: ".*test$", 117 | }, 118 | { 119 | Type: prompb.LabelMatcher_NRE, 120 | Name: "test3", 121 | Value: ".*test$", 122 | }, 123 | }, 124 | Hints: &prompb.ReadHints{ 125 | StepMs: 0, 126 | }, 127 | }, 128 | rClient{ 129 | labels: []string{"test1", "test2", "test3"}, 130 | }, 131 | "test", 132 | `| mstats latest(_value) as ropee_metric_value where index=test AND metric_name=test span=10s by metric_name test1 test2 test3| where test1!="test"| regex test2=".*test$"| regex test3!=".*test$"| rename metric_name as ropee_metric_name`, 133 | nil, 134 | }, 135 | { 136 | "missing __name__", 137 | prompb.Query{ 138 | StartTimestampMs: 0, 139 | EndTimestampMs: 10, 140 | Matchers: []*prompb.LabelMatcher{ 141 | { 142 | Type: prompb.LabelMatcher_EQ, 143 | Name: "t", 144 | Value: "test", 145 | }, 146 | }, 147 | Hints: &prompb.ReadHints{ 148 | StepMs: 0, 149 | }, 150 | }, 151 | rClient{ 152 | labels: []string{"test"}, 153 | }, 154 | "test", 155 | "", 156 | fmt.Errorf("__name__ is required"), 157 | }, 158 | { 159 | "__name__ not eq", 160 | prompb.Query{ 161 | StartTimestampMs: 0, 162 | EndTimestampMs: 10, 163 | Matchers: []*prompb.LabelMatcher{ 164 | { 165 | Type: prompb.LabelMatcher_NRE, 166 | Name: "__name__", 167 | Value: "test", 168 | }, 169 | }, 170 | Hints: &prompb.ReadHints{ 171 | StepMs: 0, 172 | }, 173 | }, 174 | rClient{ 175 | labels: []string{"test"}, 176 | }, 177 | "test", 178 | "", 179 | fmt.Errorf("metric_name label macher type error, only euqals supported"), 180 | }, 181 | } 182 | for i, c := range cases { 183 | t.Run(fmt.Sprintf("test-%d-%s", i, c.name), func(t *testing.T) { 184 | res, err := MakeSPL(&c.q, &c.cli, c.index) 185 | if res != c.wannaRes || (err != nil && err.Error() != c.wannaErr.Error()) { 186 | t.Fatalf("res: %s, %v, want: %s, %v", res, err, c.wannaRes, c.wannaErr) 187 | } 188 | }) 189 | } 190 | } 191 | 192 | func TestTimeSeriesToPromMetrics(t *testing.T) { 193 | cases := []struct { 194 | name string 195 | ts prompb.TimeSeries 196 | want []SplunkMetricEvent 197 | }{ 198 | { 199 | "one row test", 200 | prompb.TimeSeries{ 201 | Labels: []prompb.Label{ 202 | { 203 | Name: "__name__", 204 | Value: "test", 205 | }, 206 | { 207 | Name: "test", 208 | Value: "1", 209 | }, 210 | }, 211 | Samples: []prompb.Sample{ 212 | { 213 | Value: 1, 214 | Timestamp: 1, 215 | }, 216 | }, 217 | }, 218 | []SplunkMetricEvent{ 219 | { 220 | Time: 1, 221 | MetricStr: "test{test=\"1\"} 1", 222 | }, 223 | }, 224 | }, 225 | { 226 | "float value - 1.23", 227 | prompb.TimeSeries{ 228 | Labels: []prompb.Label{ 229 | { 230 | Name: "__name__", 231 | Value: "test", 232 | }, 233 | }, 234 | Samples: []prompb.Sample{ 235 | { 236 | Value: 1.23, 237 | Timestamp: 1, 238 | }, 239 | }, 240 | }, 241 | []SplunkMetricEvent{ 242 | { 243 | Time: 1, 244 | MetricStr: "test{} 1.23", 245 | }, 246 | }, 247 | }, 248 | { 249 | "multi values", 250 | prompb.TimeSeries{ 251 | Labels: []prompb.Label{ 252 | { 253 | Name: "__name__", 254 | Value: "test", 255 | }, 256 | { 257 | Name: "test", 258 | Value: "1", 259 | }, 260 | }, 261 | Samples: []prompb.Sample{ 262 | { 263 | Value: 1, 264 | Timestamp: 1, 265 | }, 266 | { 267 | Value: 2, 268 | Timestamp: 2, 269 | }, 270 | }, 271 | }, 272 | []SplunkMetricEvent{ 273 | { 274 | Time: 1, 275 | MetricStr: "test{test=\"1\"} 1", 276 | }, 277 | { 278 | Time: 2, 279 | MetricStr: "test{test=\"1\"} 2", 280 | }, 281 | }, 282 | }, 283 | { 284 | "missing __name__", 285 | prompb.TimeSeries{ 286 | Labels: []prompb.Label{ 287 | { 288 | Name: "test", 289 | Value: "1", 290 | }, 291 | }, 292 | Samples: []prompb.Sample{ 293 | { 294 | Value: 1, 295 | Timestamp: 1, 296 | }, 297 | }, 298 | }, 299 | []SplunkMetricEvent{}, 300 | }, 301 | } 302 | for i, c := range cases { 303 | t.Run(fmt.Sprintf("test-%d-%s", i, c.name), func(t *testing.T) { 304 | res := TimeSeriesToPromMetrics(c.ts) 305 | for j, r := range res { 306 | if r.Time != c.want[j].Time || r.MetricStr != c.want[j].MetricStr { 307 | t.Fatalf("unexpect res: %v, want: %v", res, c.want) 308 | } 309 | } 310 | }) 311 | } 312 | } 313 | -------------------------------------------------------------------------------- /test/log.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/go-kit/kit/log" 7 | "github.com/go-kit/kit/log/level" 8 | ) 9 | 10 | func Logger() log.Logger { 11 | var logger log.Logger 12 | logger = log.NewLogfmtLogger(os.Stdout) 13 | 14 | logger = level.NewFilter(logger, level.AllowDebug()) 15 | logger = log.With(logger, "time", log.DefaultTimestampUTC, "caller", log.DefaultCaller) 16 | return logger 17 | } 18 | -------------------------------------------------------------------------------- /test/test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | type Body struct { 9 | s string 10 | b []byte 11 | isOpen bool 12 | closeAttempts int 13 | } 14 | 15 | // NewBody creates a new instance of Body. 16 | func NewBody(s string) *Body { 17 | return (&Body{s: s}).reset() 18 | } 19 | 20 | func (body *Body) Read(b []byte) (n int, err error) { 21 | if !body.IsOpen() { 22 | return 0, fmt.Errorf("ERROR: Body has been closed") 23 | } 24 | if len(body.b) == 0 { 25 | return 0, io.EOF 26 | } 27 | n = copy(b, body.b) 28 | body.b = body.b[n:] 29 | return n, nil 30 | } 31 | 32 | // Close closes the body. 33 | func (body *Body) Close() error { 34 | if body.isOpen { 35 | body.isOpen = false 36 | body.closeAttempts++ 37 | } 38 | return nil 39 | } 40 | 41 | // IsOpen returns true if the Body has not been closed, false otherwise. 42 | func (body *Body) IsOpen() bool { 43 | return body.isOpen 44 | } 45 | 46 | func (body *Body) reset() *Body { 47 | body.isOpen = true 48 | body.b = []byte(body.s) 49 | return body 50 | } 51 | 52 | // Length returns the number of bytes in the body. 53 | func (body *Body) Length() int64 { 54 | if body == nil { 55 | return 0 56 | } 57 | return int64(len(body.b)) 58 | } 59 | --------------------------------------------------------------------------------