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

[SDK] Add workspace info in CLI telemetry #1349

Merged
merged 5 commits into from
Dec 1, 2023
Merged

[SDK] Add workspace info in CLI telemetry #1349

merged 5 commits into from
Dec 1, 2023

Conversation

D-W-
Copy link
Contributor

@D-W- D-W- commented Dec 1, 2023

This pull request includes changes related to adding telemetry logging with custom dimensions for workspace information in the PromptFlow Azure CLI. The most important changes include adding a new function _get_workspace_info(args) and modifying the entry function in _pf_azure/entry.py to support telemetry logging, as well as adding an import statement for the contextlib module and a new test method test_cli_telemetry in test_cli_with_azure.py to verify the correctness of telemetry logging.

Main changes:

  • src/promptflow/promptflow/_cli/_pf_azure/entry.py: Added a new function _get_workspace_info(args) and modified the entry function to support telemetry logging with custom dimensions related to the workspace information. [1] [2]
  • src/promptflow/tests/sdk_cli_azure_test/e2etests/test_cli_with_azure.py: Added an import statement for the contextlib module and a new test method test_cli_telemetry to verify that telemetry logging with workspace information is working correctly. [1] [2]# Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

All Promptflow Contribution checklist:

  • The pull request does not introduce [breaking changes].
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: suggested workflow.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@D-W- D-W- requested a review from a team as a code owner December 1, 2023 07:53
@github-actions github-actions bot added cli prompt flow CLI promptflow labels Dec 1, 2023
Copy link

github-actions bot commented Dec 1, 2023

SDK CLI Global Config Test Result wanhan/add_ws_info

2 tests   2 ✔️  53s ⏱️
1 suites  0 💤
1 files    0

Results for commit b986951.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 1, 2023

promptflow SDK CLI Azure E2E Test Result wanhan/add_ws_info

    2 files      2 suites   2m 0s ⏱️
113 tests   95 ✔️ 18 💤 0
226 runs  190 ✔️ 36 💤 0

Results for commit b986951.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 1, 2023

Executor Unit Test Result wanhan/add_ws_info

577 tests   575 ✔️  45s ⏱️
    1 suites      2 💤
    1 files        0

Results for commit b986951.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 1, 2023

Executor E2E Test Result wanhan/add_ws_info

142 tests   137 ✔️  1m 43s ⏱️
    1 suites      5 💤
    1 files        0

Results for commit b986951.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 1, 2023

SDK CLI Test Result wanhan/add_ws_info

2 files  2 suites   18s ⏱️
1 tests 1 ✔️ 0 💤 0
2 runs  2 ✔️ 0 💤 0

Results for commit b986951.

♻️ This comment has been updated with latest results.

Stephen1993
Stephen1993 previously approved these changes Dec 1, 2023
Copy link

github-actions bot commented Dec 1, 2023

SDK PFS E2E Test Result wanhan/add_ws_info

  2 files    2 suites   1m 10s ⏱️
15 tests 15 ✔️ 0 💤 0
30 runs  30 ✔️ 0 💤 0

Results for commit b986951.

♻️ This comment has been updated with latest results.

@D-W- D-W- merged commit 20cfed8 into main Dec 1, 2023
35 checks passed
@D-W- D-W- deleted the wanhan/add_ws_info branch December 1, 2023 08:57
elliotzh pushed a commit that referenced this pull request Dec 1, 2023
This pull request includes changes related to adding telemetry logging
with custom dimensions for workspace information in the PromptFlow Azure
CLI. The most important changes include adding a new function
`_get_workspace_info(args)` and modifying the `entry` function in
`_pf_azure/entry.py` to support telemetry logging, as well as adding an
import statement for the `contextlib` module and a new test method
`test_cli_telemetry` in `test_cli_with_azure.py` to verify the
correctness of telemetry logging.

Main changes:

* <a
href="diffhunk://#diff-3f1dd7459115086f5d3af3d298744079416aebf0a0a99d19883591e7e053cf19R91-R102">`src/promptflow/promptflow/_cli/_pf_azure/entry.py`</a>:
Added a new function `_get_workspace_info(args)` and modified the
`entry` function to support telemetry logging with custom dimensions
related to the workspace information. <a
href="diffhunk://#diff-3f1dd7459115086f5d3af3d298744079416aebf0a0a99d19883591e7e053cf19R91-R102">[1]</a>
<a
href="diffhunk://#diff-3f1dd7459115086f5d3af3d298744079416aebf0a0a99d19883591e7e053cf19L99-R117">[2]</a>
* <a
href="diffhunk://#diff-d5a4a429f9ab76787a5800c3c679ac45e94ca9b5193e3f726ab9d528397ee339L4-R11">`src/promptflow/tests/sdk_cli_azure_test/e2etests/test_cli_with_azure.py`</a>:
Added an import statement for the `contextlib` module and a new test
method `test_cli_telemetry` to verify that telemetry logging with
workspace information is working correctly. <a
href="diffhunk://#diff-d5a4a429f9ab76787a5800c3c679ac45e94ca9b5193e3f726ab9d528397ee339L4-R11">[1]</a>
<a
href="diffhunk://#diff-d5a4a429f9ab76787a5800c3c679ac45e94ca9b5193e3f726ab9d528397ee339R172-R196">[2]</a>#
Description

Please add an informative description that covers that changes made by
the pull request and link all relevant issues.

# All Promptflow Contribution checklist:
- [ ] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [ ] Title of the pull request is clear and informative.
- [ ] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.

(cherry picked from commit 20cfed8)
elliotzh pushed a commit that referenced this pull request Dec 1, 2023
This pull request includes changes related to adding telemetry logging
with custom dimensions for workspace information in the PromptFlow Azure
CLI. The most important changes include adding a new function
`_get_workspace_info(args)` and modifying the `entry` function in
`_pf_azure/entry.py` to support telemetry logging, as well as adding an
import statement for the `contextlib` module and a new test method
`test_cli_telemetry` in `test_cli_with_azure.py` to verify the
correctness of telemetry logging.

Main changes:

* <a
href="diffhunk://#diff-3f1dd7459115086f5d3af3d298744079416aebf0a0a99d19883591e7e053cf19R91-R102">`src/promptflow/promptflow/_cli/_pf_azure/entry.py`</a>:
Added a new function `_get_workspace_info(args)` and modified the
`entry` function to support telemetry logging with custom dimensions
related to the workspace information. <a
href="diffhunk://#diff-3f1dd7459115086f5d3af3d298744079416aebf0a0a99d19883591e7e053cf19R91-R102">[1]</a>
<a
href="diffhunk://#diff-3f1dd7459115086f5d3af3d298744079416aebf0a0a99d19883591e7e053cf19L99-R117">[2]</a>
* <a
href="diffhunk://#diff-d5a4a429f9ab76787a5800c3c679ac45e94ca9b5193e3f726ab9d528397ee339L4-R11">`src/promptflow/tests/sdk_cli_azure_test/e2etests/test_cli_with_azure.py`</a>:
Added an import statement for the `contextlib` module and a new test
method `test_cli_telemetry` to verify that telemetry logging with
workspace information is working correctly. <a
href="diffhunk://#diff-d5a4a429f9ab76787a5800c3c679ac45e94ca9b5193e3f726ab9d528397ee339L4-R11">[1]</a>
<a
href="diffhunk://#diff-d5a4a429f9ab76787a5800c3c679ac45e94ca9b5193e3f726ab9d528397ee339R172-R196">[2]</a>#
Description

Please add an informative description that covers that changes made by
the pull request and link all relevant issues.

# All Promptflow Contribution checklist:
- [ ] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [ ] Title of the pull request is clear and informative.
- [ ] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.

(cherry picked from commit 20cfed8)
crazygao pushed a commit that referenced this pull request Dec 4, 2023
This pull request includes changes related to adding telemetry logging
with custom dimensions for workspace information in the PromptFlow Azure
CLI. The most important changes include adding a new function
`_get_workspace_info(args)` and modifying the `entry` function in
`_pf_azure/entry.py` to support telemetry logging, as well as adding an
import statement for the `contextlib` module and a new test method
`test_cli_telemetry` in `test_cli_with_azure.py` to verify the
correctness of telemetry logging.

Main changes:

* <a
href="diffhunk://#diff-3f1dd7459115086f5d3af3d298744079416aebf0a0a99d19883591e7e053cf19R91-R102">`src/promptflow/promptflow/_cli/_pf_azure/entry.py`</a>:
Added a new function `_get_workspace_info(args)` and modified the
`entry` function to support telemetry logging with custom dimensions
related to the workspace information. <a
href="diffhunk://#diff-3f1dd7459115086f5d3af3d298744079416aebf0a0a99d19883591e7e053cf19R91-R102">[1]</a>
<a
href="diffhunk://#diff-3f1dd7459115086f5d3af3d298744079416aebf0a0a99d19883591e7e053cf19L99-R117">[2]</a>
* <a
href="diffhunk://#diff-d5a4a429f9ab76787a5800c3c679ac45e94ca9b5193e3f726ab9d528397ee339L4-R11">`src/promptflow/tests/sdk_cli_azure_test/e2etests/test_cli_with_azure.py`</a>:
Added an import statement for the `contextlib` module and a new test
method `test_cli_telemetry` to verify that telemetry logging with
workspace information is working correctly. <a
href="diffhunk://#diff-d5a4a429f9ab76787a5800c3c679ac45e94ca9b5193e3f726ab9d528397ee339L4-R11">[1]</a>
<a
href="diffhunk://#diff-d5a4a429f9ab76787a5800c3c679ac45e94ca9b5193e3f726ab9d528397ee339R172-R196">[2]</a>#
Description

Please add an informative description that covers that changes made by
the pull request and link all relevant issues.

# All Promptflow Contribution checklist:
- [ ] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [ ] Title of the pull request is clear and informative.
- [ ] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli prompt flow CLI promptflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants