Skip to content

Commit

Permalink
remove /providers API from azurerm logs only
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-henglu committed Sep 27, 2023
1 parent 8da9689 commit 464c912
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var providers = []provider.Provider{
provider.AzAPIProvider{},
}

var providerUrlRegex = regexp.MustCompile(`/subscriptions/[a-zA-Z\d\-]+/providers`)
var providerUrlRegex = regexp.MustCompile(`/subscriptions/[a-zA-Z\d\-]+/providers\?`)

func RequestTracesFromFile(input string) ([]types.RequestTrace, error) {
data, err := os.ReadFile(input)
Expand Down Expand Up @@ -60,7 +60,7 @@ func RequestTracesFromFile(input string) ([]types.RequestTrace, error) {
mergedTraces := make([]types.RequestTrace, 0)
for i := 0; i < len(traces); i++ {
// skip GET /subscriptions/******/providers
if traces[i].Method == "GET" && providerUrlRegex.MatchString(traces[i].Url) {
if traces[i].Method == "GET" && providerUrlRegex.MatchString(traces[i].Url) && traces[i].Provider == "azurerm" {
continue
}

Expand Down

0 comments on commit 464c912

Please sign in to comment.