-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into PORT-12403-create-cloud-resources-using-ia-c
- Loading branch information
Showing
73 changed files
with
7,499 additions
and
588 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
name: Weekly Kapa Usage Report | ||
|
||
on: | ||
schedule: | ||
# Runs at 7:00 AM UTC every Monday | ||
- cron: '0 7 * * 1' | ||
workflow_dispatch: # Allows manual triggering | ||
|
||
jobs: | ||
generate-and-send-report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get Current Date | ||
id: date | ||
run: | | ||
echo "start_date=$(date -d '7 days ago' -u +%Y-%m-%dT00:00:00Z)" >> $GITHUB_ENV | ||
echo "end_date=$(date -u +%Y-%m-%dT23:59:59Z)" >> $GITHUB_ENV | ||
- name: Fetch Kapa Analytics | ||
id: fetch-analytics | ||
run: | | ||
# Make the API call and store response directly to file | ||
curl -v -s -X GET \ | ||
"https://api.kapa.ai/query/v1/projects/e64464bc-19b5-4cd2-9779-2930e2ca0b81/analytics/activity/?start_date_time=${{ env.start_date }}&end_date_time=${{ env.end_date }}&aggregation_period=WEEK" \ | ||
-H "X-API-KEY: ${{ secrets.KAPA_API_KEY }}" \ | ||
-o kapa_response.json | ||
# Debug: Print the first part of the response | ||
echo "API Response (first 500 chars):" | ||
head -c 500 kapa_response.json | ||
# Validate JSON response | ||
if ! jq empty kapa_response.json; then | ||
echo "Error: Invalid JSON response from API" | ||
echo "Full response:" | ||
cat kapa_response.json | ||
exit 1 | ||
fi | ||
# Verify the response has the expected structure | ||
if ! jq -e '.aggregate_statistics' kapa_response.json > /dev/null; then | ||
echo "Error: Response missing aggregate_statistics" | ||
echo "Response structure:" | ||
jq '.' kapa_response.json | ||
exit 1 | ||
fi | ||
if ! jq -e '.time_series' kapa_response.json > /dev/null; then | ||
echo "Error: Response missing time_series" | ||
echo "Response structure:" | ||
jq '.' kapa_response.json | ||
exit 1 | ||
fi | ||
# Create formatted message sections | ||
period_text="Period: $(date -d '${{ env.start_date }}' '+%B %d') - $(date -d '${{ env.end_date }}' '+%B %d, %Y')" | ||
# Calculate uncertain percentage | ||
total_questions=$(jq -r '.aggregate_statistics.total_questions' kapa_response.json) | ||
uncertain_questions=$(jq -r '.aggregate_statistics.total_questions_uncertain' kapa_response.json) | ||
if [ "$total_questions" -gt 0 ]; then | ||
uncertain_percentage=$(echo "scale=1; $uncertain_questions * 100 / $total_questions" | bc) | ||
else | ||
uncertain_percentage=0 | ||
fi | ||
key_metrics="*Key Metrics:*\n• Total Questions: $(jq -r '.aggregate_statistics.total_questions' kapa_response.json)\n• Unique Users: $(jq -r '.aggregate_statistics.total_unique_users' kapa_response.json)\n• Uncertain Responses: $uncertain_questions ($uncertain_percentage%)" | ||
quality_metrics="*Quality Metrics:*\n• Upvotes: $(jq -r '.aggregate_statistics.total_upvotes' kapa_response.json)\n• Downvotes: $(jq -r '.aggregate_statistics.total_downvotes' kapa_response.json)" | ||
# Calculate success rate | ||
total_votes=$(jq -r '.aggregate_statistics.total_upvotes + .aggregate_statistics.total_downvotes' kapa_response.json) | ||
if [ "$total_votes" -gt 0 ]; then | ||
success_rate=$(echo "scale=1; $(jq -r '.aggregate_statistics.total_upvotes' kapa_response.json) * 100 / $total_votes" | bc) | ||
success_text="\n*Success Rate:* ${success_rate}%" | ||
else | ||
success_text="" | ||
fi | ||
# Get counts for each integration | ||
# Community channel count | ||
community_count=$(jq -r ' | ||
.time_series | | ||
map(.count_by_integration[]) | | ||
map(select(.type == "SLACK_CHANNEL" and (.description | test("community"; "i")))) | | ||
map(.count) | | ||
add // 0 | ||
' kapa_response.json) | ||
# Docs AI count | ||
docs_ai_count=$(jq -r ' | ||
.time_series | | ||
map(.count_by_integration[]) | | ||
map(select(.description == "Docs AI")) | | ||
map(.count) | | ||
add // 0 | ||
' kapa_response.json) | ||
# Ask-ai internal Slack count | ||
internal_slack_count=$(jq -r ' | ||
.time_series | | ||
map(.count_by_integration[]) | | ||
map(select(.description == "Ask-ai internal Slack")) | | ||
map(.count) | | ||
add // 0 | ||
' kapa_response.json) | ||
# Combine all integrations in the desired order | ||
integration_text="\n\n*Questions by Integration:*" | ||
integration_text+="\n• Docs widget: $docs_ai_count" | ||
integration_text+="\n• Community Slack channel: $community_count" | ||
integration_text+="\n• Internal Slack channel: $internal_slack_count" | ||
# Send to Slack using curl | ||
curl -X POST -H 'Content-type: application/json' \ | ||
--data "{ | ||
\"text\": \"📊 *Weekly Kapa.ai Usage Report*\n${period_text}\n\n${key_metrics}\n\n${quality_metrics}${success_text}${integration_text}\" | ||
}" \ | ||
${{ secrets.SLACK_WEBHOOK_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ This page will introduce the agent and guide you through the installation and co | |
|
||
## Prerequisites | ||
|
||
- Connection credentials to Kafka are required. To obtain them, contact us via the intercom bubble in the bottom-right corner, or via our [community Slack](https://www.getport.io/community). | ||
- Connection credentials to Kafka are required. To obtain them, contact us using Intercom/Slack/mail to [[email protected]](mailto:support@getport.io). | ||
- [Helm](https://helm.sh) must be installed in order to install the relevant chart. | ||
- In order to trigger a GitLab Pipeline, you need to have a [GitLab trigger token](https://docs.gitlab.com/ee/ci/triggers/). | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ The steps shown in the image above are as follows: | |
## Further steps | ||
|
||
- See the [Triggering example](#Triggering-example) for Circle CI. | ||
- Contact us through Intercom to set up a Kafka topic for your organization. | ||
- Contact us using Intercom/Slack/mail to [[email protected]](mailto:[email protected]) to set up a Kafka topic for your organization. | ||
- [Install the Port execution agent to trigger the Circle CI pipeline](#Installation). | ||
|
||
## Triggering example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ In this guide, we will show how to deploy a new `AWS Lambda function`, that will | |
## Prerequisites | ||
|
||
:::note | ||
To follow this example, please contact us via Intercom to receive a dedicated Kafka topic. | ||
To follow this example, please contact us using Intercom/Slack/mail to [[email protected]](mailto:[email protected]) to receive a dedicated Kafka topic. | ||
::: | ||
|
||
- AWS CLI installed and configured to your desired AWS account; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ Our Port agent is open source - see it [**here**](https://github.com/port-labs/p | |
::: | ||
|
||
:::note | ||
To use the execution agent, please contact us via Intercom to receive a dedicated Kafka topic. | ||
To use the execution agent, please contact us using Intercom/Slack/mail to [[email protected]](mailto:[email protected]) to receive a dedicated Kafka topic. | ||
::: | ||
|
||
The data flow when using the Port execution agent is as follows: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ token** or **team token**. | |
## Further steps | ||
|
||
- See the [Triggering example](#Triggering-example) for Terraform Cloud. | ||
- Contact us through Intercom to set up a Kafka topic for your organization. | ||
- Contact us using Intercom/Slack/mail to [[email protected]](mailto:[email protected]) to set up a Kafka topic for your organization. | ||
- [Install the Port execution agent to trigger the Terraform Cloud Run](#Installation). | ||
|
||
## Triggering example | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
id: security | ||
title: "Security" | ||
description: "" | ||
sidebar_label: Security | ||
sidebar_position: 2 | ||
hide_title: true | ||
--- | ||
|
||
import EnterpriseNote from "/docs/generalTemplates/_enterprise_feature_notice.md"; | ||
|
||
# Security | ||
|
||
This page includes security information about Port API and the interactions of your infrastructure with it. | ||
|
||
## Address Allowlisting | ||
|
||
Port's REST API is served through a network of Application Load Balancers (ALBs) and as such is not served from a closed list of IP addresses. | ||
|
||
For cases where your internal network has strict limitations on the addresses that outbound requests can be made to, you will need to add the following addresses to your network's allowlist: | ||
|
||
- For Port's EU tenant: | ||
- [https://api.getport.io](https://api.getport.io) | ||
- [https://ingest.getport.io](https://ingest.getport.io) | ||
- For Port's US tenant: | ||
- [https://api.us.getport.io](https://api.us.getport.io) | ||
- [https://ingest.us.getport.io](https://ingest.us.getport.io) | ||
|
||
## AWS PrivateLink | ||
|
||
<EnterpriseNote /> | ||
|
||
Port supports AWS PrivateLink to provide secure connectivity between your AWS [VPC](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) and Port's API. | ||
|
||
AWS [PrivateLink](https://aws.amazon.com/privatelink/) is an AWS service that provides private connectivity between resources in different AWS VPCs. | ||
|
||
With AWS PrivateLink you can make requests to Port's API from your AWS VPC, while ensuring that the traffic remains within the AWS data center, and without exposing your data to the internet. | ||
|
||
### Setup | ||
|
||
To setup an AWS PrivateLink between your VPC and Port, you can follow [this AWS guide](https://docs.aws.amazon.com/vpc/latest/privatelink/create-endpoint-service.html#connect-to-endpoint-service). | ||
|
||
In step 5 of the guide, you are required to provide the **Service name**, which is the address of the PrivateLink address provided by Port, here are the Port API PrivateLink service names: | ||
|
||
| Service | Public Address | PrivateLink Region | PrivateLink Service Name | | ||
| ------------- | ------------------------------------------------------------ | ------------------ | --------------------------------------------------------- | | ||
| Port API EU | [https://api.getport.io](https://api.getport.io) | `eu-west-1` | `com.amazonaws.vpce.eu-west-1.vpce-svc-02addcefd47049d3f` | | ||
| Ingest API EU | [https://ingest.getport.io](https://ingest.getport.io) | `eu-west-1` | `com.amazonaws.vpce.eu-west-1.vpce-svc-01c8de843e5776402` | | ||
| Port API US | [https://api.us.getport.io](https://api.us.getport.io) | `us-east-1` | `com.amazonaws.vpce.us-east-1.vpce-svc-047de27e65a0392a7` | | ||
| Ingest API US | [https://ingest.us.getport.io](https://ingest.us.getport.io) | `us-east-1` | `com.amazonaws.vpce.us-east-1.vpce-svc-052d7ea18ebda9652` | | ||
|
||
**Note:** In case your AWS resources are in a different region than the ones Port's PrivateLinks are hosted at, refer to step 6 of the guide to setup a cross region connection. | ||
|
||
After following the guide, please contact Port's support team using Intercom/Slack/mail to [[email protected]](mailto:[email protected]) and we will finalize the setup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.