Skip to content

Commit cee5d43

Browse files
[POA-860] Replace postman lc with postman insights (#256)
Done changes acc to this: https://postmanlabs.atlassian.net/wiki/spaces/PO/pages/4911792297/Plan+Agent+rebranding#User-visible-strings-in-the-binary --------- Co-authored-by: Jed Liu <[email protected]>
1 parent 741d5cf commit cee5d43

24 files changed

+95
-95
lines changed

.github/workflows/security-scan.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ jobs:
1111
name: Security Scan Job
1212
uses: postmanlabs/gh-security-scan-workflow/.github/workflows/[email protected]
1313
with:
14-
imagename: postman-lc-agent
14+
imagename: postman-insights-agent
1515
language: "['go']"
16-

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*.dll
55
*.so
66
*.dylib
7-
postman-lc-agent
7+
postman-insights-agent
88
bin/
99

1010
# Test binary, built with `go test -c`

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
export GO111MODULE = on
44

55
build: clean
6-
go build -o bin/postman-lc-agent .
6+
go build -o bin/postman-insights-agent .
77

88
clean:
99
go clean

apidump/net.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func showPermissionErrors(sampleError error) error {
4747
printer.Warningf("It might be that you are in a PaaS that disallows packet capture, or the local configuration has disabled that privilege by default.\n")
4848
return NewApidumpError(api_schema.ApidumpError_PCAPPermission, "Insufficient permissions in container.")
4949
} else {
50-
printer.Warningf("Although you are running as root, the Postman Live Collections Agent lacks the CAP_NET_RAW capability.\n")
50+
printer.Warningf("Although you are running as root, the Postman Insights Agent lacks the CAP_NET_RAW capability.\n")
5151
printer.Warningf("It might be that you are in a restricted environment which disallows packet capture, even as the root user.\n")
5252
return NewApidumpError(api_schema.ApidumpError_PCAPPermission, "Insufficient permissions.")
5353
}
@@ -63,23 +63,23 @@ func showPermissionErrors(sampleError error) error {
6363

6464
printer.Warningf(
6565
"The agent received \"Function not implemented\" when trying to read from your network interfaces. "+
66-
"This often indicates that the Postman Live Collections Agent was built for a different architecture than your host architecture. "+
67-
"This Postman Live Collections Agent binary was built for %s.\n",
66+
"This often indicates that the Postman Insights Agent was built for a different architecture than your host architecture. "+
67+
"This Postman Insights Agent binary was built for %s.\n",
6868
arch,
6969
)
7070

7171
if env.InDocker() {
7272
return NewApidumpErrorf(
7373
api_schema.ApidumpError_PCAPInterfaceNotImplemented,
7474
"Unable to read network interfaces. If your host architecture is not %s, try using "+
75-
"`docker pull --platform $YOUR_ARCHITECTURE docker.postman.com/postman-lc-agent:latest` to pull a Postman Live Collections Agent "+
75+
"`docker pull --platform $YOUR_ARCHITECTURE docker.postman.com/postman-insights-agent:latest` to pull a Postman Insights Agent "+
7676
"built for your architecture.",
7777
arch,
7878
)
7979
} else {
8080
return NewApidumpErrorf(
8181
api_schema.ApidumpError_PCAPInterfaceNotImplemented,
82-
"Unable to read network interfaces. If your host architecture is not %s, try using the Postman Live Collections Agent install script: `bash -c \"$(curl -L https://releases.observability.postman.com/scripts/install-postman-lc-agent.sh)\"`",
82+
"Unable to read network interfaces. If your host architecture is not %s, try using the Postman Insights Agent install script: `bash -c \"$(curl -L https://releases.observability.postman.com/scripts/install-postman-insights-agent.sh)\"`",
8383
arch,
8484
)
8585
}

apidump/summary.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func (s *Summary) PrintWarnings() {
301301
s.PrefilterSummary.Total().HTTPRequests)
302302
}
303303
if env.InDocker() && env.HasDockerInternalHostAddress() {
304-
printer.Stderr.Infof("If you're using macOS and your service is not running in a Docker container, try using the native Postman Live Collections Agent with `brew install postman-lc-agent`.\n")
304+
printer.Stderr.Infof("If you're using macOS and your service is not running in a Docker container, try using the native Postman Insights Agent with `brew install postman-insights-agent`.\n")
305305
}
306306
printer.Stderr.Errorf("%s 🛑\n\n", printer.Color.Red("No HTTP calls captured!"))
307307
return

apispec/har.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func ProcessHAR(col trace.Collector, p string) (int, error) {
3131
if errs.TotalCount > 0 {
3232
entriesCount := len(harContent.Log.Entries)
3333
printer.Stderr.Warningf("Encountered errors with %d HAR file entries.\n", entriesCount-successCount)
34-
printer.Stderr.Warningf("Postman Live Insights will ignore entries with errors and generate a spec from the %d entries successfully processed.\n", successCount)
34+
printer.Stderr.Warningf("Postman Insights will ignore entries with errors and generate a spec from the %d entries successfully processed.\n", successCount)
3535

3636
printer.Stderr.Warningf("Sample errors:\n")
3737
for _, e := range errs.Samples {

cmd/internal/cmderr/checks.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func RequirePostmanAPICredentials(explanation string) (string, error) {
3535
if env.InDocker() {
3636
printer.Infof("Please set the POSTMAN_API_KEY environment variables on the Docker command line.\n")
3737
} else {
38-
printer.Infof("Use the POSTMAN_API_KEY environment variables, or run 'postman-lc-agent login'.\n")
38+
printer.Infof("Use the POSTMAN_API_KEY environment variables, or run 'postman-insights-agent login'.\n")
3939
}
4040

4141
return "", AkitaErr{Err: errors.New("could not find an Postman API key to use")}

cmd/internal/ec2/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
### Introduction
44

5-
- The Postman Live Collection Agent (LCA) runs as a systemd service on your server
6-
- The Postman collection is populated with endpoints observed from the traffic arriving at your service.
5+
- The Postman Insights Agent runs as a systemd service on your server
6+
- The Postman Insights project is populated with endpoints observed from the traffic arriving at your service.
77

88
### Prerequisites
99

@@ -14,23 +14,23 @@
1414

1515
- Log in as root user, or use `sudo su` to enable root before running the below command
1616
```
17-
POSTMAN_API_KEY=<postman-api-key> postman-lc-agent setup --collection <postman-collectionID>
17+
POSTMAN_API_KEY=<postman-api-key> postman-insights-agent setup --collection <postman-collectionID>
1818
```
1919

2020
To check the status or logs please use
2121

2222
```
23-
journalctl -fu postman-lc-agent
23+
journalctl -fu postman-insights-agent
2424
```
2525

2626
#### Why is root required?
2727

2828
- To enable and configure the agent as a systemd services
29-
- Env Configuration file location `/etc/default/postman-lc-agent`
30-
- Systemd service file location `/usr/lib/systemd/system/postman-lc-agent.service`
29+
- Env Configuration file location `/etc/default/postman-insights-agent`
30+
- Systemd service file location `/usr/lib/systemd/system/postman-insights-agent.service`
3131

3232
### Uninstall
3333

3434
- You can disable the systemd service using
3535

36-
`sudo systemctl disable --now postman-lc-agent`
36+
`sudo systemctl disable --now postman-insights-agent`

cmd/internal/ec2/add.go

+19-19
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@ import (
1515
)
1616

1717
const (
18-
envFileName = "postman-lc-agent"
19-
envFileTemplateName = "postman-lc-agent.tmpl"
18+
envFileName = "postman-insights-agent"
19+
envFileTemplateName = "postman-insights-agent.tmpl"
2020
envFileBasePath = "/etc/default/"
2121
envFilePath = envFileBasePath + envFileName
2222

23-
serviceFileName = "postman-lc-agent.service"
23+
serviceFileName = "postman-insights-agent.service"
2424
serviceFileBasePath = "/usr/lib/systemd/system/"
2525
serviceFilePath = serviceFileBasePath + serviceFileName
2626

27-
// Output of command: systemctl is-enabled postman-lc-agent
27+
// Output of command: systemctl is-enabled postman-insights-agent
2828
// Refer: https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#Exit%20status
29-
enabled = "enabled" // exit code: 0
30-
disabled = "disabled" // exit code: 1
31-
nonExisting = "Failed to get unit file state for postman-lc-agent.service: No such file or directory" // exit code: 1
29+
enabled = "enabled" // exit code: 0
30+
disabled = "disabled" // exit code: 1
31+
nonExisting = "Failed to get unit file state for postman-insights-agent.service: No such file or directory" // exit code: 1
3232
)
3333

3434
// Embed files inside the binary. Requires Go >=1.16
3535

36-
//go:embed postman-lc-agent.service
36+
//go:embed postman-insights-agent.service
3737
var serviceFile string
3838

3939
// FS is used for easier template parsing
4040

41-
//go:embed postman-lc-agent.tmpl
41+
//go:embed postman-insights-agent.tmpl
4242
var envFileFS embed.FS
4343

4444
// Helper function for reporting telemetry
@@ -73,8 +73,8 @@ func setupAgentForServer(collectionId string) error {
7373
func askToReconfigure() error {
7474
var isReconfigure bool
7575

76-
printer.Infof("postman-lc-agent is already present as a systemd service\n")
77-
printer.Infof("Helpful commands \n Check status: systemctl status postman-lc-agent \n Disable agent: systemctl disable --now postman-lc-agent \n Check Logs: journalctl -fu postman-lc-agent\n Check env file: cat %s \n Check systemd service file: cat %s \n", envFilePath, serviceFilePath)
76+
printer.Infof("postman-insights-agent is already present as a systemd service\n")
77+
printer.Infof("Helpful commands \n Check status: systemctl status postman-insights-agent \n Disable agent: systemctl disable --now postman-insights-agent \n Check Logs: journalctl -fu postman-insights-agent\n Check env file: cat %s \n Check systemd service file: cat %s \n", envFilePath, serviceFilePath)
7878

7979
err := survey.AskOne(
8080
&survey.Confirm{
@@ -98,7 +98,7 @@ func askToReconfigure() error {
9898
// Check is systemd service already exists
9999
func checkReconfiguration() error {
100100

101-
cmd := exec.Command("systemctl", []string{"is-enabled", "postman-lc-agent"}...)
101+
cmd := exec.Command("systemctl", []string{"is-enabled", "postman-insights-agent"}...)
102102
out, err := cmd.CombinedOutput()
103103

104104
if err != nil {
@@ -113,7 +113,7 @@ func checkReconfiguration() error {
113113
return nil
114114
}
115115
}
116-
return errors.Wrapf(err, "failed to run systemctl is-enabled posman-lc-agent")
116+
return errors.Wrapf(err, "failed to run systemctl is-enabled postman-insights-agent")
117117
}
118118
if strings.Contains(string(out), enabled) {
119119
return askToReconfigure()
@@ -125,7 +125,7 @@ func checkReconfiguration() error {
125125
func checkUserPermissions() error {
126126

127127
// Exact permissions required are
128-
// read/write permissions on /etc/default/postman-lc-agent
128+
// read/write permissions on /etc/default/postman-insights-agent
129129
// read/write permission on /usr/lib/system/systemd
130130
// enable, daemon-reload, start, stop permission for systemctl
131131

@@ -214,9 +214,9 @@ func configureSystemdFiles(collectionId string) error {
214214
return nil
215215
}
216216

217-
// Starts the postman LCA agent as a systemd service
217+
// Starts the Postman Insights Agent as a systemd service
218218
func enablePostmanAgent() error {
219-
message := "Enabling postman-lc-agent as a service"
219+
message := "Enabling postman-insights-agent as a service"
220220
reportStep(message)
221221
printer.Infof(message + "\n")
222222

@@ -225,14 +225,14 @@ func enablePostmanAgent() error {
225225
if err != nil {
226226
return errors.Wrapf(err, "failed to run systemctl daemon-reload")
227227
}
228-
// systemctl start postman-lc-service
228+
// systemctl start postman-insights-agent.service
229229
cmd = exec.Command("systemctl", []string{"enable", "--now", serviceFileName}...)
230230
_, err = cmd.CombinedOutput()
231231
if err != nil {
232232
return errors.Wrapf(err, "faild to run systemctl enable --now")
233233
}
234-
printer.Infof("Postman LC Agent enabled as a systemd service. Please check logs using the below command \n")
235-
printer.Infof("journalctl -fu postman-lc-agent \n")
234+
printer.Infof("Postman Insights Agent enabled as a systemd service. Please check logs using the below command \n")
235+
printer.Infof("journalctl -fu postman-insights-agent \n")
236236

237237
return nil
238238
}

cmd/internal/ec2/ec2.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ var (
1919
var Cmd = &cobra.Command{
2020
Deprecated: "This is no longer supported and might be removed in a future release.",
2121
Use: "setup",
22-
Short: "Add the Postman Live Collections Agent to the current server.",
23-
Long: "The CLI will add the Postman Live Collections Agent as a systemd service to your current server.",
22+
Short: "Add the Postman Insights Agent to the current server.",
23+
Long: "The CLI will add the Postman Insights Agent as a systemd service to your current server.",
2424
SilenceUsage: true,
2525
RunE: addAgentToEC2,
2626
}
2727

2828
var RemoveFromEC2Cmd = &cobra.Command{
2929
Use: "remove",
30-
Short: "Remove the Postman Live Collections Agent from EC2.",
31-
Long: "Remove a previously installed Postman agent from an EC2 server.",
30+
Short: "Remove the Postman Insights Agent from EC2.",
31+
Long: "Remove a previously installed Postman Insights agent from an EC2 server.",
3232
SilenceUsage: true,
3333
RunE: removeAgentFromEC2,
3434

@@ -45,7 +45,7 @@ func init() {
4545

4646
func addAgentToEC2(cmd *cobra.Command, args []string) error {
4747
// Check for API key
48-
_, err := cmderr.RequirePostmanAPICredentials("The Postman Live Collections Agent must have an API key in order to capture traces.")
48+
_, err := cmderr.RequirePostmanAPICredentials("The Postman Insights Agent must have an API key in order to capture traces.")
4949
if err != nil {
5050
return err
5151
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[Unit]
2-
Description=Postman Live Collections Agent
2+
Description=Postman Insights Agent
33
Wants=network-online.target
44
After=network-online.target NetworkManager.service systemd-resolved.service
55

66
[Service]
7-
EnvironmentFile=/etc/default/postman-lc-agent
7+
EnvironmentFile=/etc/default/postman-insights-agent
88
# DO NOT CHANGE
99
# "${FOO}" uses the arguement as is, while "$FOO" splits the string on white space
1010
# Reference: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Command%20lines
11-
ExecStart=/usr/bin/postman-lc-agent apidump --collection "${COLLECTION_ID}" --interfaces "${INTERFACES}" --filter "${FILTER}" "$EXTRA_APIDUMP_ARGS"
11+
ExecStart=/usr/bin/postman-insights-agent apidump --collection "${COLLECTION_ID}" --interfaces "${INTERFACES}" --filter "${FILTER}" "$EXTRA_APIDUMP_ARGS"
1212

1313
[Install]
1414
WantedBy=multi-user.target

cmd/internal/ec2/postman-lc-agent.tmpl cmd/internal/ec2/postman-insights-agent.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
POSTMAN_API_KEY={{.PostmanAPIKey}}
88

99

10-
# Add your your Postman Live Collection ID.
10+
# Add your your Postman Collection ID.
1111
#This is required.
1212

1313
COLLECTION_ID={{.CollectionId}}
@@ -30,7 +30,7 @@ FILTER=
3030

3131

3232
# Configure any extra arguments you wish to provide to the
33-
# 'postman-lc-agent apidump' command. For example,
33+
# 'postman-insights-agent apidump' command. For example,
3434
#
3535
# EXTRA_APIDUMP_ARGS="--rate-limit 100"
3636
#

cmd/internal/ecs/add.go

+14-13
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,21 @@ type AddWorkflow struct {
8686
const (
8787
// Tag to use for objects created by the Akita CLI
8888
akitaCreationTagKey = "postman:created_by"
89-
akitaCreationTagValue = "Postman Live Insights ECS integration"
89+
akitaCreationTagValue = "Postman Insights ECS integration"
9090
akitaModificationTagKey = "postman:modified_by"
91-
akitaModificationTagValue = "Postman Live Insights ECS integration"
91+
akitaModificationTagValue = "Postman Insights ECS integration"
9292

9393
// Separate AWS secrets for the key ID and key secret
9494
// TODO: make these configurable
9595
akitaSecretPrefix = "postman/"
9696
defaultKeyIDName = akitaSecretPrefix + "api_key_id"
9797
defaultKeySecretName = akitaSecretPrefix + "api_key_secret"
9898

99-
// Postman Live Collections Agent image locations
99+
// Akita CLI image location
100100
akitaECRImage = "public.ecr.aws/akitasoftware/akita-cli"
101101
akitaDockerImage = "akitasoftware/cli"
102-
postmanECRImage = "docker.postman.com/postman-lc-agent"
102+
// Postman Insights Agent image location
103+
postmanECRImage = "docker.postman.com/postman-insights-agent"
103104
)
104105

105106
// Run the "add to ECS" workflow until we complete or get an error.
@@ -486,7 +487,7 @@ func getTaskState(wf *AddWorkflow) (nextState optionals.Optional[AddWorkflowStat
486487
err = survey.AskOne(
487488
&survey.Select{
488489
Message: "Which task should be monitored?",
489-
Help: "Select the ECS task definition to modify. We will add the Postman Live Collections Agent as a sidecar to the task.",
490+
Help: "Select the ECS task definition to modify. We will add the Postman Insights Agent as a sidecar to the task.",
490491
Options: tasks,
491492
},
492493
&taskAnswer,
@@ -529,11 +530,11 @@ func getTaskState(wf *AddWorkflow) (nextState optionals.Optional[AddWorkflowStat
529530
}
530531
}
531532

532-
// Check that the postman-lc-agent is not already present
533+
// Check that the postman-insights-agent is not already present
533534
for _, container := range output.ContainerDefinitions {
534535
image := aws.ToString(container.Image)
535536
if matchesImage(image, postmanECRImage) || matchesImage(image, akitaECRImage) || matchesImage(image, akitaDockerImage) {
536-
printer.Errorf("The selected task definition already has the image %q; postman-lc-agent is already installed.\n", image)
537+
printer.Errorf("The selected task definition already has the image %q; postman-insights-agent is already installed.\n", image)
537538
printer.Infof("Please select a different task definition, or hit Ctrl+C to exit.\n")
538539
return awf_next(getTaskState)
539540
}
@@ -668,7 +669,7 @@ func (wf *AddWorkflow) showPlannedChanges() {
668669
defaultKeySecretName, wf.awsRegion)
669670
}
670671
}
671-
printer.Infof("Create a new version %d of task definition %q which includes the Postman Live Collections Agent as a sidecar.\n",
672+
printer.Infof("Create a new version %d of task definition %q which includes the Postman Insights Agent as a sidecar.\n",
672673
wf.ecsTaskDefinition.Revision+1, wf.ecsTaskDefinitionFamily)
673674
printer.Infof("Update service %q in cluster %q to the new task definition.\n",
674675
wf.ecsService, wf.ecsCluster)
@@ -808,7 +809,7 @@ func addSecretState(wf *AddWorkflow) (nextState optionals.Optional[AddWorkflowSt
808809
return awf_next(modifyTaskState)
809810
}
810811

811-
// Create a new revision of the task definition which includes the postman-lc-agent container.
812+
// Create a new revision of the task definition which includes the postman-insights-agent container.
812813
func modifyTaskState(wf *AddWorkflow) (nextState optionals.Optional[AddWorkflowState], err error) {
813814
reportStep("Modify ECS Task Definition")
814815

@@ -851,13 +852,13 @@ func modifyTaskState(wf *AddWorkflow) (nextState optionals.Optional[AddWorkflowS
851852
var entryPoint []string
852853

853854
if collectionId != "" {
854-
entryPoint = []string{"/postman-lc-agent", "apidump", "--collection", collectionId}
855+
entryPoint = []string{"/postman-insights-agent", "apidump", "--collection", collectionId}
855856
} else {
856-
entryPoint = []string{"/postman-lc-agent", "apidump", "--project", projectId}
857+
entryPoint = []string{"/postman-insights-agent", "apidump", "--project", projectId}
857858
}
858859

859860
agentContainer := types.ContainerDefinition{
860-
Name: aws.String("postman-lc-agent"),
861+
Name: aws.String("postman-insights-agent"),
861862
EntryPoint: entryPoint,
862863
Environment: append(envs, []types.KeyValuePair{
863864
{Name: aws.String("POSTMAN_API_KEY"), Value: &pKey},
@@ -1028,6 +1029,6 @@ func waitForRestartState(wf *AddWorkflow) (nextState optionals.Optional[AddWorkf
10281029
}
10291030

10301031
reportStep("ECS Service Updated")
1031-
printer.Infof("Deployment successful! Please return to the Postman Live collection you created.\n")
1032+
printer.Infof("Deployment successful! Please return to the Postman Insights project that you created.\n")
10321033
return awf_done()
10331034
}

0 commit comments

Comments
 (0)