-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[receiver/vcenter] Construct MetricsReceiver Component #9224
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
Merged
djaglowski
merged 140 commits into
open-telemetry:main
from
observIQ:vmwarevcenterreceiver-metricsreceiver
May 26, 2022
Merged
Changes from 131 commits
Commits
Show all changes
140 commits
Select commit
Hold shift + click to select a range
a878428
add vcenter vSAN collection
schmikei c4a1025
checkpoint on getting property collection working
schmikei e686bb8
checkpoint before integration test
schmikei 0311440
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 5dbcbc6
dual receivers under root receiver pointer
schmikei ee81978
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei a61e963
checkpoint before updated mdatagen
schmikei 560f6c3
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 349148d
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 0a9edb4
use syslog receiver rather than tcplogreceiver
schmikei ffe05e4
getting more performance counter refinements
schmikei 67f292f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 4f4aeb6
remove unneccessary component addition
schmikei d95221f
try to fix go.mod resolution issues
schmikei d2f9356
try to fix go.mod resolution issues pt 2
schmikei d52200b
addlicense
schmikei a684fd5
fix go.mod by fixing require directive
schmikei 655dbbd
Merge branch 'main' into vmwarevcenterreceiver-metricsreceiver
schmikei bc35c19
add readme for metrics
schmikei 68e3313
Merge branch 'vmwarevcenterreceiver-metricsreceiver' of github.com:ob…
schmikei ac81137
update readme
schmikei 85bcccd
fix go.mod referring nonexistent version
schmikei f92cb2b
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei a191060
add performance manager tests
schmikei bd93bd9
more tests
schmikei 49c22ad
add more attributes to virtual machines and host systems
schmikei 17c4ed8
add more attributes to virtual machines and host systems
schmikei 0051336
spike changelog entry
schmikei fd3ba25
fix go.mod in both places
schmikei debfe53
fix go.mod in configschema
schmikei 371a491
add // import github.com/open-telemetry/opentelemetry-collector-contr…
schmikei 02a326d
add quotations
schmikei 8d84602
add to receiver lifecycle
schmikei ba2ce31
remove extra go generate direction
schmikei 87fea71
fix typo of utilizaiton in metric description
schmikei 407819e
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 64109a4
small changes to interval id in performance queries to be more consis…
schmikei bb45c02
PR feedback including omitting company name prefix
schmikei ac7e105
PR feedback to not fail starting the component on potential network f…
schmikei 05669dd
minor grammar correction in vcenter readme
schmikei cbd2e97
update expected metrics
schmikei bab0085
update host_effective attribute value
schmikei 3c02116
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 3baa6f8
remove PerformanceInterval customizability
schmikei e554a2e
add to codeowners
schmikei 09cd252
Merge branch 'main' into vmwarevcenterreceiver-metricsreceiver
schmikei 9a8b9fb
fix indentation on merge conflict
schmikei 5f90aa5
fix changelog entry place so its in the new components section
schmikei 389caf6
update to be on 0.49.0 of the collector'
schmikei 3ac56e9
add PR number to changelog
schmikei 23d6fe6
regenerate with newer version of mdatagen
schmikei b9fb5d6
move error log if unable to connect on start to receiver.Start() rath…
schmikei 33e0cf6
fix test cases from last commit
schmikei 83b4570
minor update to config with tests
schmikei 291cbea
Merge branch 'main' into vmwarevcenterreceiver-metricsreceiver
schmikei f1c37e4
fix metric description
schmikei 81aaa55
Merge branch 'vmwarevcenterreceiver-metricsreceiver' of github.com:ob…
schmikei c458195
use utc for host vsan collection as well
schmikei 6cd2403
Merge branch 'main' into vmwarevcenterreceiver-metricsreceiver
schmikei a52583b
update comments of public facing methods
schmikei dfc5bb0
return errors on getting clusters to the scraper errors
schmikei 138f588
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei f00c1e1
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei dc8f2ea
PR feedback #1
schmikei faf80c5
instantiate new client if client is nil
schmikei 3a2e793
update all descriptions to have punctuation
schmikei 2cd9dc7
three more descs
schmikei fba2b5b
move ensureReceiver up to once we validated as a config
schmikei a956cd2
some more PR feedback
schmikei f51f366
looking into race conditions
schmikei c0f7609
run go tidy
schmikei 60ab408
fix import order and remove unneccessary mutex
schmikei 981f399
remove mutex from struct
schmikei 39f402c
refactor client to responsible for knowing if the vsan endpoints are …
schmikei 4f2374c
fix integration test referencing old var
schmikei 8b23b88
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei a07307e
change metrics.metrics => metrics.settings, update client pr feedback
schmikei 5d62c14
remove vSAN collection temporarily
schmikei 1a16fc2
remove extra metric attributes for vSAN
schmikei 13502dc
remove vsan specific variables
schmikei 471b2b2
clean up host PerfCounter disk latency metrics and fix some descripti…
schmikei 9fcf326
add 20s interval to extended documentation as needed
schmikei 27bff1d
mdatagen fixes
schmikei c647af0
add integration test metric scrape
schmikei 91ab463
gotidy
schmikei d2f840d
fix import order
schmikei af000cc
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei e64e04d
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei a1023ca
go up to 0.49.1
schmikei fd560e4
gotidy
schmikei a914b5f
add replace directive for semconv
schmikei 913924a
Merge branch 'main' into vmwarevcenterreceiver-metricsreceiver
schmikei b408153
gotidy fixes
schmikei 4a8a674
fix component not being on 0.50.0
schmikei 423489f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 8d5bd4e
update to v0.50.1-0.20220429151328-041f39835df7
schmikei 53a6529
use newer mdatagen
schmikei 0f0e5ae
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 42246f3
remove any logging functionality change && update documentation
schmikei b552ce4
fix integration test from flattening of config
schmikei 712ed6a
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 8357e75
fix scraper start not erroring if connection cannot be established
schmikei 50aa4be
make scrapertest less flaky
schmikei b05e419
format test json
schmikei b4c9c24
Apply suggestions from code review
schmikei efa4d72
adjust metric definition for vcenter.host.disk.throughput
schmikei 74a9808
Merge branch 'vmwarevcenterreceiver-metricsreceiver' of github.com:ob…
schmikei 1439070
remove comment and move pm level 2 metrics to appropriate section
schmikei e7e3307
try to be respective of datacenters
schmikei 9d11adf
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei cdf9aae
fix only vCenter server functionality
schmikei f64408e
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei ab1f40e
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 04671a3
try building out a mock server for test coverage
schmikei ba52924
make goporto
schmikei ce9a924
fix build issues
schmikei 7457f1b
use latest mdatagen
schmikei 08493ea
add newlines to ends of xml recordings
schmikei 6dc5d7e
fix integration test
schmikei 694c1a6
moved around scrapererrors because now the receiver is datacenter dep…
schmikei f4fad03
try and do an audit of performance metrics and requests/responses
schmikei 17703ab
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei e61a5dd
update testdata with correct units
schmikei ee54511
make tidy
schmikei 8a0968f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 111c1e4
make tidy
schmikei 2d05ac7
update collector version
schmikei 6a7007b
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 9704501
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei 770db40
fix local testing code including modules
schmikei 0426b76
remove deprecated use of commonponenterror
schmikei 8eb488c
pr feedback; add method of collection recording, return poweredOn/pow…
schmikei aaf9c21
remove content.json
schmikei 8b7bd0e
fix description change in scraper_test.go
schmikei f87fe73
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei e66c018
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei c88282d
update collector version
schmikei 7634f35
bump replaced module; rebuild load tests
schmikei 5ee6e15
fix alibaba version auto localizing
schmikei e8bd19b
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
schmikei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| include ../../Makefile.Common |
This file contains hidden or 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,46 @@ | ||
| # vCenter Receiver | ||
|
|
||
| This receiver fetches metrics from a vCenter or ESXi host running VMware vSphere APIs. | ||
|
|
||
| Supported pipeline types: `metrics` | ||
|
|
||
| > :construction: This receiver is in **Alpha**. Configuration fields and metric data model are subject to change. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| This receiver has been built to support ESXi and vCenter versions: | ||
|
|
||
| - 7.0 | ||
| - 6.7 | ||
| - 7.5 | ||
|
|
||
| A “Read Only” user assigned to a vSphere with permissions to the vCenter server, cluster and all subsequent resources being monitored must be specified in order for the receiver to retrieve information about them. | ||
|
|
||
| ## Configuration | ||
|
|
||
|
|
||
| | Parameter | Default | Type | Notes | | ||
| | --- | --- | --- | --- | | ||
| | endpoint | | String | Endpoint to the vCenter Server or ESXi host that has the sdk path enabled. Required. The expected format is `<protocol>://<hostname>` <br><br> i.e: `https://vcsa.hostname.localnet` | | ||
| | username | | String | Required | | ||
| | password | | String | Required | | ||
| | tls | | TLSClientSetting | Not Required. Will use defaults for [configtls.TLSClientSetting](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md). By default insecure settings are rejected and certificate verification is on. | | ||
djaglowski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| | collection_interval | 2m | Duration | This receiver collects metrics on an interval. If the vCenter is fairly large, this value may need to be increased. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h` | | ||
|
|
||
| ### Example Configuration | ||
|
|
||
| ```yaml | ||
| receivers: | ||
| vcenter: | ||
| endpoint: http://localhost:15672 | ||
| username: otelu | ||
| password: $VCENTER_PASSWORD | ||
| collection_interval: 5m | ||
| metrics: [] | ||
| ``` | ||
|
|
||
| The full list of settings exposed for this receiver are documented [here](./config.go) with detailed sample configurations [here](./testdata/config.yaml). TLS config is documented further under the [opentelemetry collector's configtls package](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md). | ||
|
|
||
| ## Metrics | ||
|
|
||
| Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml) with further documentation in [documentation.md](./documentation.md) | ||
This file contains hidden or 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,154 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package vcenterreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver" | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "net/url" | ||
|
|
||
| "github.com/vmware/govmomi" | ||
| "github.com/vmware/govmomi/find" | ||
| "github.com/vmware/govmomi/object" | ||
| "github.com/vmware/govmomi/performance" | ||
| "github.com/vmware/govmomi/property" | ||
| "github.com/vmware/govmomi/vim25" | ||
| vt "github.com/vmware/govmomi/vim25/types" | ||
| ) | ||
|
|
||
| // vcenterClient is a client that | ||
| type vcenterClient struct { | ||
| moClient *govmomi.Client | ||
| vimDriver *vim25.Client | ||
| finder *find.Finder | ||
| pc *property.Collector | ||
| pm *performance.Manager | ||
| cfg *Config | ||
| } | ||
|
|
||
| func newVcenterClient(c *Config) *vcenterClient { | ||
| return &vcenterClient{ | ||
| cfg: c, | ||
| } | ||
| } | ||
|
|
||
| // EnsureConnection will establish a connection to the vSphere SDK if not already established | ||
| func (vc *vcenterClient) EnsureConnection(ctx context.Context) error { | ||
| if vc.moClient != nil { | ||
| return nil | ||
| } | ||
|
|
||
| sdkURL, err := vc.cfg.SDKUrl() | ||
| if err != nil { | ||
| return err | ||
| } | ||
| client, err := govmomi.NewClient(ctx, sdkURL, vc.cfg.Insecure) | ||
| if err != nil { | ||
| return fmt.Errorf("unable to connect to vSphere SDK on listed endpoint: %w", err) | ||
| } | ||
| tlsCfg, err := vc.cfg.LoadTLSConfig() | ||
| if err != nil { | ||
| return err | ||
| } | ||
| client.DefaultTransport().TLSClientConfig = tlsCfg | ||
| user := url.UserPassword(vc.cfg.Username, vc.cfg.Password) | ||
| err = client.Login(ctx, user) | ||
| if err != nil { | ||
| return fmt.Errorf("unable to login to vcenter sdk: %w", err) | ||
| } | ||
| vc.moClient = client | ||
| vc.vimDriver = client.Client | ||
| vc.pc = property.DefaultCollector(vc.vimDriver) | ||
| vc.finder = find.NewFinder(vc.vimDriver) | ||
| vc.pm = performance.NewManager(vc.vimDriver) | ||
| return nil | ||
| } | ||
|
|
||
| // Disconnect will logout of the autenticated session | ||
| func (vc *vcenterClient) Disconnect(ctx context.Context) error { | ||
| if vc.moClient != nil { | ||
| return vc.moClient.Logout(ctx) | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
| // Clusters returns the clusterComputeResources of the vSphere SDK | ||
| func (vc *vcenterClient) Datacenters(ctx context.Context) ([]*object.Datacenter, error) { | ||
| datacenters, err := vc.finder.DatacenterList(ctx, "*") | ||
| if err != nil { | ||
| return []*object.Datacenter{}, fmt.Errorf("unable to get datacenter lists: %w", err) | ||
| } | ||
| return datacenters, nil | ||
| } | ||
|
|
||
| // Clusters returns the clusterComputeResources of the vSphere SDK | ||
| func (vc *vcenterClient) Clusters(ctx context.Context, datacenter *object.Datacenter) ([]*object.ClusterComputeResource, error) { | ||
| vc.finder = vc.finder.SetDatacenter(datacenter) | ||
| clusters, err := vc.finder.ClusterComputeResourceList(ctx, "*") | ||
| if err != nil { | ||
| return []*object.ClusterComputeResource{}, err | ||
| } | ||
| return clusters, nil | ||
| } | ||
|
|
||
| // ResourcePools returns the resourcePools in the vSphere SDK | ||
| func (vc *vcenterClient) ResourcePools(ctx context.Context) ([]*object.ResourcePool, error) { | ||
| rps, err := vc.finder.ResourcePoolList(ctx, "*") | ||
| if err != nil { | ||
| return nil, fmt.Errorf("unable to retrieve resource pools: %w", err) | ||
| } | ||
| return rps, err | ||
| } | ||
|
|
||
| func (vc *vcenterClient) VMs(ctx context.Context) ([]*object.VirtualMachine, error) { | ||
| vms, err := vc.finder.VirtualMachineList(ctx, "*") | ||
| if err != nil { | ||
| return nil, fmt.Errorf("unable to retrieve resource pools: %w", err) | ||
| } | ||
| return vms, err | ||
| } | ||
|
|
||
| type perfSampleResult struct { | ||
| counters map[string]*vt.PerfCounterInfo | ||
| results []performance.EntityMetric | ||
| } | ||
|
|
||
| func (vc *vcenterClient) performanceQuery( | ||
| ctx context.Context, | ||
| spec vt.PerfQuerySpec, | ||
| names []string, | ||
| objs []vt.ManagedObjectReference, | ||
| ) (*perfSampleResult, error) { | ||
| if vc.pm == nil { | ||
| return &perfSampleResult{}, nil | ||
| } | ||
| vc.pm.Sort = true | ||
| sample, err := vc.pm.SampleByName(ctx, spec, names, objs) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| result, err := vc.pm.ToMetricSeries(ctx, sample) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| counterInfoByName, err := vc.pm.CounterInfoByName(ctx) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return &perfSampleResult{ | ||
| counters: counterInfoByName, | ||
| results: result, | ||
| }, nil | ||
| } |
This file contains hidden or 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,66 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package vcenterreceiver // import github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver | ||
|
|
||
| import ( | ||
| "context" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| "github.com/vmware/govmomi/find" | ||
| "github.com/vmware/govmomi/simulator" | ||
| "github.com/vmware/govmomi/vim25" | ||
| ) | ||
|
|
||
| func TestGetClusters(t *testing.T) { | ||
| simulator.Test(func(ctx context.Context, c *vim25.Client) { | ||
| finder := find.NewFinder(c) | ||
| client := vcenterClient{ | ||
| vimDriver: c, | ||
| finder: finder, | ||
| } | ||
| dc, err := finder.DefaultDatacenter(ctx) | ||
| require.NoError(t, err) | ||
| clusters, err := client.Clusters(ctx, dc) | ||
| require.NoError(t, err) | ||
| require.NotEmpty(t, clusters, 0) | ||
| }) | ||
| } | ||
|
|
||
| func TestGetResourcePools(t *testing.T) { | ||
| simulator.Test(func(ctx context.Context, c *vim25.Client) { | ||
| finder := find.NewFinder(c) | ||
| client := vcenterClient{ | ||
| vimDriver: c, | ||
| finder: finder, | ||
| } | ||
| resourcePools, err := client.ResourcePools(ctx) | ||
| require.NoError(t, err) | ||
| require.NotEmpty(t, resourcePools) | ||
| }) | ||
| } | ||
|
|
||
| func TestGetVMs(t *testing.T) { | ||
| simulator.Test(func(ctx context.Context, c *vim25.Client) { | ||
| finder := find.NewFinder(c) | ||
| client := vcenterClient{ | ||
| vimDriver: c, | ||
| finder: finder, | ||
| } | ||
| vms, err := client.VMs(ctx) | ||
| require.NoError(t, err) | ||
| require.NotEmpty(t, vms) | ||
| }) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort()