Skip to content

Commit 0263597

Browse files
committed
Initial migration of Prometheus plugin for Elasticsearch to OpenSearch
The main changes are: - Java package renaming and moving it to where opensearchplugin recommends - Merging of conflicts (mainly build.gradle) - Fixing integration tests (testing cluster has different name) - Configuring correct versions of Gradle (and JDK for GitHub CI) - Upgrade to Prometheus Java client to the latest version - Adding missing licenses for dependencies Closes Aiven-Open#2 Closes Aiven-Open#4 Signed-off-by: lukas-vlcek <lukas.vlcek@aiven.io>
1 parent 8dc7f85 commit 0263597

File tree

63 files changed

+1337
-486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1337
-486
lines changed

.github/workflows/CI.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build and Test Plugin Template
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
java: [14]
16+
name: Build and Test Plugin Template
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up JDK ${{ matrix.java }}
22+
uses: actions/setup-java@v1
23+
with:
24+
java-version: ${{ matrix.java }}
25+
26+
- name: Build and Run Tests
27+
run: |
28+
./gradlew --info build

.github/workflows/ci.yml

-47
This file was deleted.

.github/workflows/dco.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Developer Certificate of Origin Check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
check:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Get PR Commits
11+
id: 'get-pr-commits'
12+
uses: tim-actions/get-pr-commits@v1.1.0
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
- name: DCO Check
16+
uses: tim-actions/dco@v1.1.0
17+
with:
18+
commits: ${{ steps.get-pr-commits.outputs.commits }}

.gitignore

+50-13
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,59 @@
22
# https://discuss.elastic.co/t/leftovers-after-integtestrunner-in-root/152610
33
\.local*-integTestRunner-execution-times.log
44

5-
# Eclipse
6-
.classpath
7-
.project
8-
.settings/
9-
10-
# Intellij
5+
# intellij files
116
.idea/
127
*.iml
13-
*.iws
148
*.ipr
9+
*.iws
10+
build-idea/
11+
out/
12+
13+
# include shared intellij config
14+
!.idea/inspectionProfiles/Project_Default.xml
15+
!.idea/runConfigurations/Debug_OpenSearch.xml
16+
17+
# These files are generated in the main tree by IntelliJ
18+
benchmarks/src/main/generated/*
19+
20+
# eclipse files
21+
.project
22+
.classpath
23+
.settings
24+
build-eclipse/
25+
26+
# netbeans files
27+
nb-configuration.xml
28+
nbactions.xml
29+
30+
# gradle stuff
31+
.gradle/
32+
build/
1533

16-
# Gradle
17-
.gradle
18-
build
19-
gradle-wrapper.jar
20-
gradle-wrapper.properties
34+
# vscode stuff
35+
.vscode/
2136

22-
# Mac
37+
# testing stuff
38+
**/.local*
39+
.vagrant/
40+
/logs/
41+
42+
# osx stuff
2343
.DS_Store
44+
45+
# default folders in which the create_bwc_index.py expects to find old es versions in
46+
/backwards
47+
/dev-tools/backwards
48+
49+
# needed in case docs build is run...maybe we can configure doc build to generate files under build?
50+
html_docs
51+
52+
# random old stuff that we should look at the necessity of...
53+
/tmp/
54+
eclipse-build
55+
56+
# projects using testfixtures
57+
testfixtures_shared/
58+
59+
# These are generated from .ci/jobs.t
60+
.ci/jobs/

CONTRIBUTING.md

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Contributing Guidelines
2+
3+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4+
documentation, we greatly value feedback and contributions from our community.
5+
6+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7+
information to effectively respond to your bug report or contribution.
8+
9+
10+
## Reporting Bugs/Feature Requests
11+
12+
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13+
14+
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
15+
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16+
17+
* A reproducible test case or series of steps
18+
* The version of our code being used
19+
* Any modifications you've made relevant to the bug
20+
* Anything unusual about your environment or deployment
21+
22+
23+
## Contributing via Pull Requests
24+
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25+
26+
1. You are working against the latest source on the *main* branch.
27+
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28+
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29+
30+
To send us a pull request, please:
31+
32+
1. Fork the repository.
33+
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34+
3. Ensure local tests pass.
35+
4. Commit to your fork using clear commit messages.
36+
5. Send us a pull request, answering any default questions in the pull request interface.
37+
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
38+
39+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
40+
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
41+
42+
## Developer Certificate of Origin
43+
44+
OpenSearch is an open source product released under the Apache 2.0 license (see either [the Apache site](https://www.apache.org/licenses/LICENSE-2.0) or the [LICENSE.txt file](LICENSE)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software.
45+
46+
We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that.
47+
48+
The DCO is a declaration attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a `Signed-off-by` statement and thereby agrees to the DCO, which you can find below or at [DeveloperCertificate.org](http://developercertificate.org/).
49+
50+
```
51+
Developer's Certificate of Origin 1.1
52+
53+
By making a contribution to this project, I certify that:
54+
55+
(a) The contribution was created in whole or in part by me and I
56+
have the right to submit it under the open source license
57+
indicated in the file; or
58+
59+
(b) The contribution is based upon previous work that, to the
60+
best of my knowledge, is covered under an appropriate open
61+
source license and I have the right under that license to
62+
submit that work with modifications, whether created in whole
63+
or in part by me, under the same open source license (unless
64+
I am permitted to submit under a different license), as
65+
Indicated in the file; or
66+
67+
(c) The contribution was provided directly to me by some other
68+
person who certified (a), (b) or (c) and I have not modified
69+
it.
70+
71+
(d) I understand and agree that this project and the contribution
72+
are public and that a record of the contribution (including
73+
all personal information I submit with it, including my
74+
sign-off) is maintained indefinitely and may be redistributed
75+
consistent with this project or the open source license(s)
76+
involved.
77+
```
78+
79+
We require that every contribution to OpenSearch is signed with a Developer Certificate of Origin. Additionally, please use your real name. We do not accept anonymous contributors nor those utilizing pseudonyms.
80+
81+
Each commit must include a DCO which looks like this
82+
83+
```
84+
Signed-off-by: Jane Smith <jane.smith@email.com>
85+
```
86+
87+
You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `– – signoff` to add the `Signed-off-by` line to the end of the commit message.
88+
89+
## Finding contributions to work on
90+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
91+
92+
93+
## Code of Conduct
94+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
95+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
96+
opensource-codeofconduct@amazon.com with any additional questions or comments.
97+
98+
99+
## Security issue notifications
100+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
101+
102+
## License Headers
103+
104+
New files in your code contributions should contain the following license header. If you are modifying existing files with license headers, or including new files that already have license headers, do not remove or modify them without guidance.
105+
106+
```
107+
/*
108+
* Copyright OpenSearch Contributors
109+
* SPDX-License-Identifier: Apache-2.0
110+
*/
111+
```
112+
113+
## Licensing
114+
115+
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

0 commit comments

Comments
 (0)