Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH 1451 #1454

Closed
wants to merge 5 commits into from
Closed

GH 1451 #1454

wants to merge 5 commits into from

Conversation

yaniveliash
Copy link

Description

A CLI Tool to generate a stub for new observability integrations

Issues Resolved

#1451

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@yaniveliash yaniveliash requested a review from a team as a code owner March 7, 2023 07:38
@ps48
Copy link
Member

ps48 commented Mar 7, 2023

@yaniveliash Thank you so much for your contribution. I see the DCO is failing on the pull request. Can you please provide sign-offs to your commits? You can checkout more details here: https://github.com/opensearch-project/observability/pull/1454/checks?check_run_id=11814492848

@YANG-DB YANG-DB added enhancement New feature or request feature labels Mar 7, 2023
Signed-off-by: Yaniv Eliash <yaniv@sre.engineer>
Signed-off-by: Yaniv Eliash <yaniv@sre.engineer>
Signed-off-by: Yaniv Eliash <yaniv@sre.engineer>
Signed-off-by: Yaniv Eliash <yaniv@sre.engineer>
@yaniveliash
Copy link
Author

@yaniveliash Thank you so much for your contribution. I see the DCO is failing on the pull request. Can you please provide sign-offs to your commits? You can checkout more details here: https://github.com/opensearch-project/observability/pull/1454/checks?check_run_id=11814492848

Done
I'm pretty sure there will be more to fix ;-)

@YANG-DB
Copy link
Member

YANG-DB commented Mar 7, 2023

Hi @yaniveliash
Thanks again for your contribution .

  • can you plz add categories & collection section for user interaction ?

Copy link
Collaborator

@Swiddis Swiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I left some comments for minor tweaks regarding cross-platform stability, but otherwise this is a good start.

scripts/integrations/main.py Outdated Show resolved Hide resolved
scripts/integrations/main.py Outdated Show resolved Hide resolved
@@ -0,0 +1,2 @@
[DEFAULT]
LICENSE = MIT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be apache 2.0?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe?
I'm less familiar with opensource licenses and regulations,
I've placed it just for default value concept and will change it to whatever needed :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apache-2.0 for compatibility with SPDX, but I agree.

}}

with open(directory + '/config.json', 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=4)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would only be for local data dump - should we think about how can we add this globally, not just on this cluster? Automated way to create a PR, etc.?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derek-ho
Is that a design question for the team or something for me to rethink about?
ain't sure :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see design RFC

  the script's path
* Changed file and directories path concatanation to os.path.join
* Linter kicked in and formatted the file.

Signed-off-by: Yaniv Eliash <yaniv@sre.engineer>
@YANG-DB
Copy link
Member

YANG-DB commented Mar 7, 2023

Can you plz add a README.md describing the flow of this CLI ?
thanks 🙏

schema: str = typer.Option(
"", "--schema", "-s", help="Which schema, and at which version, to use. The data will be ingested with this schema."),
catalog: str = typer.Option(
"", "--catalog", "-c", help="The specific catalog to target, such as `observability` or `security`."),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have an functionality that will scan the /schema folder and present the results for the customer to select from ?
see https://github.com/opensearch-project/observability/tree/2.6/schema

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which part to scan in particular?
folder names? (e.g. metrics and traces) or something else?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need the option to provide a checkout tag?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the next PR has additional clarification on the catalog folder structure and information
see catalog.json

sys.exit(1)


def main(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the general flow for this CLI would be as follows:

  • General: select the schema from a closed list
    For each collections:
  "collection":[
    {
      "logs": [{
        "info": "access logs",
        "input_type":"logfile",
        "dataset":"nginx.access",
        "labels" :["nginx","access"],
        "schema": "./schema/logs/access.json"
      },
...
  • Collections: select number of collections
  • For Each :
    • Select schema category for collection (sub folder in the schema )
    • input info, dataset , labels, schema
    • select input_type from a list given from file names (without suffixes ) under the schema folder

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From where can I source the list of collections and their respective schemas?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above comment ...

@YANG-DB YANG-DB added the integration Integration project label Mar 7, 2023
@YANG-DB YANG-DB requested review from YANG-DB, Swiddis and derek-ho and removed request for Swiddis March 8, 2023 20:01
@YANG-DB
Copy link
Member

YANG-DB commented Mar 9, 2023

IMO u can mark this PR as draft for now ...

@Swiddis
Copy link
Collaborator

Swiddis commented Mar 14, 2023

Hi,

The requirements for the tool have been considerably fleshed out. The updated spec is available on issue #1451. Are you available to keep working on this?

For an initial PR, it would be sufficient to stub out the 3 described commands, create, package, and check. These can just be routed to different no-op methods with arguments. If you want to add more functionality on top of that, by all means, feel free to do so.

}}

with open(directory + '/config.json', 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=4)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see design RFC

@Swiddis
Copy link
Collaborator

Swiddis commented Aug 8, 2023

Closed for inactivity. The design of the CLI has changed considerably since the integrations project has taken off, so the modern form of it fills a different purpose. The current version of the CLI is available at the OpenSearch Catalog.

@Swiddis Swiddis closed this Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature integration Integration project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants