Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54
version: v1.64.4

check-license:
name: License scan
Expand Down
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ linters-settings:
- github.com/stackvista
lll:
line-length: 250
gomnd:
mnd:
checks:
- argument
- case
Expand All @@ -47,15 +47,15 @@ linters:
- dupl
- errcheck
- exhaustive
- exportloopref
- copyloopvar
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gomnd
- mnd
- goprintffuncname
# - gosec TODO: enable when fixed
- gosimple
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mkdir -p ~/.config/nix && echo "experimental-features = nix-command flakes" >> ~
4. Enter development shell `nix develop`
5. Run `go run main.go`

It also possible to use nix phases to test `nix develop --check` and build the application `nix develop --build`, as specified in the Makefile, without entering the shell.
It's also possible to use nix phases to test `nix develop --check` and build the application `nix develop --build`, as specified in the Makefile, without entering the shell.

6. Read the [command development guide](CMD_DEVELOPMENT.md).

Expand Down
22 changes: 16 additions & 6 deletions cmd/context/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@ import (
)

func PrintConnectionSuccess(pr printer.Printer, apiUrl string, serverInfo *stackstate_api.ServerInfo) {
pr.Success(
fmt.Sprintf("Connection verified to %s (StackState version: %s)",
apiUrl,
client.VersionToString(serverInfo.Version),
),
)
if serverInfo.PlatformVersion != nil {
pr.Success(
fmt.Sprintf("Connection verified to %s (Platform version: %s)",
apiUrl,
*serverInfo.PlatformVersion,
),
)
} else {
// Fallback to serverInfo.Version if platformVersion is not present (an updated client could interact with a server not supporting PlatformVersion yet).
pr.Success(
fmt.Sprintf("Connection verified to %s (StackState version: %s)",
apiUrl,
client.VersionToString(serverInfo.Version),
),
)
}
}

func ValidateContext(cli *di.Deps, cmd *cobra.Command, cfg *config.StsContext) (*stackstate_api.ServerInfo, common.CLIError) {
Expand Down
8 changes: 4 additions & 4 deletions cmd/health/health_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ func metricBucketToJson(name string, bucket []stackstate_api.MetricBucketValue,
return map[string]interface{}{
"name": name,
fmt.Sprintf("now-%d", size): metricValueOrDash(bucket, 0),
fmt.Sprintf("%d-%d", size, 2*size): metricValueOrDash(bucket, 1), //nolint:gomnd
fmt.Sprintf("%d-%d", 2*size, 3*size): metricValueOrDash(bucket, 2), //nolint:gomnd
fmt.Sprintf("%d-%d", size, 2*size): metricValueOrDash(bucket, 1), //nolint:mnd
fmt.Sprintf("%d-%d", 2*size, 3*size): metricValueOrDash(bucket, 2), //nolint:mnd
}
}

Expand All @@ -150,14 +150,14 @@ func metricBucketToRow(name string, bucket []stackstate_api.MetricBucketValue) [
name,
metricValueOrDash(bucket, 0),
metricValueOrDash(bucket, 1),
metricValueOrDash(bucket, 2), //nolint:gomnd
metricValueOrDash(bucket, 2), //nolint:mnd
}
}

func streamMetricsToTable(metrics stackstate_api.HealthStreamMetrics) printer.TableData {
size := metrics.BucketSizeSeconds
return printer.TableData{
Header: []string{"Metric", fmt.Sprintf("%ds ago", size), fmt.Sprintf("%d-%ds ago", size, 2*size), fmt.Sprintf("%d-%ds ago", 2*size, 3*size)}, //nolint:gomnd
Header: []string{"Metric", fmt.Sprintf("%ds ago", size), fmt.Sprintf("%d-%ds ago", size, 2*size), fmt.Sprintf("%d-%ds ago", 2*size, 3*size)}, //nolint:mnd
Data: [][]interface{}{
metricBucketToRow("latency seconds", metrics.LatencySeconds),
metricBucketToRow("messages per seconds", metrics.MessagePerSecond),
Expand Down
22 changes: 22 additions & 0 deletions generated/stackstate_api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ api_stackpack.go
api_subject.go
api_subscription.go
api_system_notifications.go
api_timeline.go
api_topic.go
api_topology_synchronization.go
api_traces.go
api_user_authorization.go
api_user_profile.go
api_user_session.go
client.go
Expand Down Expand Up @@ -81,6 +83,7 @@ docs/ComponentHighlightMetricSection.md
docs/ComponentHighlightMetricSectionAllOf.md
docs/ComponentNotFoundError.md
docs/ComponentQuery.md
docs/ComponentViewArguments.md
docs/CreateSubject.md
docs/DataUnavailable.md
docs/DependencyDirection.md
Expand All @@ -100,6 +103,7 @@ docs/EventCategoryBucket.md
docs/EventComponent.md
docs/EventCursor.md
docs/EventElement.md
docs/EventFilters.md
docs/EventItemsWithTotal.md
docs/EventListRequest.md
docs/EventNotFoundError.md
Expand Down Expand Up @@ -297,6 +301,7 @@ docs/PromSeriesEnvelope.md
docs/PromVector.md
docs/PromVectorResult.md
docs/ProvisionResponse.md
docs/QueryViewArguments.md
docs/ReleaseStatus.md
docs/RequestError.md
docs/RequestValidationError.md
Expand Down Expand Up @@ -359,6 +364,13 @@ docs/TeamsChannelRefId.md
docs/TeamsChannelWriteSchema.md
docs/TeamsNotificationChannel.md
docs/TeamsNotificationChannelAllOf.md
docs/TimelineApi.md
docs/TimelineSummary.md
docs/TimelineSummaryError.md
docs/TimelineSummaryEventBucket.md
docs/TimelineSummaryHealthChange.md
docs/TimelineSummaryRequest.md
docs/TimelineSummaryRequestArguments.md
docs/TooManyActiveQueries.md
docs/TooManyTopologyResults.md
docs/Topic.md
Expand Down Expand Up @@ -391,6 +403,7 @@ docs/Traces.md
docs/TracesApi.md
docs/UnlicensedSubscription.md
docs/UnmatchedCheckState.md
docs/UserAuthorizationApi.md
docs/UserNameMismatchError.md
docs/UserNotFoundError.md
docs/UserNotLoggedInError.md
Expand Down Expand Up @@ -444,6 +457,7 @@ model_component_highlight_metric_section.go
model_component_highlight_metric_section_all_of.go
model_component_not_found_error.go
model_component_query.go
model_component_view_arguments.go
model_create_subject.go
model_data_unavailable.go
model_dependency_direction.go
Expand All @@ -461,6 +475,7 @@ model_event_category_bucket.go
model_event_component.go
model_event_cursor.go
model_event_element.go
model_event_filters.go
model_event_items_with_total.go
model_event_list_request.go
model_event_not_found_error.go
Expand Down Expand Up @@ -644,6 +659,7 @@ model_prom_series_envelope.go
model_prom_vector.go
model_prom_vector_result.go
model_provision_response.go
model_query_view_arguments.go
model_release_status.go
model_request_error.go
model_request_validation_error.go
Expand Down Expand Up @@ -699,6 +715,12 @@ model_teams_channel_ref_id.go
model_teams_channel_write_schema.go
model_teams_notification_channel.go
model_teams_notification_channel_all_of.go
model_timeline_summary.go
model_timeline_summary_error.go
model_timeline_summary_event_bucket.go
model_timeline_summary_health_change.go
model_timeline_summary_request.go
model_timeline_summary_request_arguments.go
model_too_many_active_queries.go
model_too_many_topology_results.go
model_topic.go
Expand Down
11 changes: 11 additions & 0 deletions generated/stackstate_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ Class | Method | HTTP request | Description
*SubscriptionApi* | [**GetSubscription**](docs/SubscriptionApi.md#getsubscription) | **Get** /subscription | Get subscription info
*SubscriptionApi* | [**PostSubscription**](docs/SubscriptionApi.md#postsubscription) | **Post** /subscription | Submit a new license to update the subscription
*SystemNotificationsApi* | [**AllSystemNotifications**](docs/SystemNotificationsApi.md#allsystemnotifications) | **Get** /system/notifications | Overview of system notifications
*TimelineApi* | [**GetTimelineSummary**](docs/TimelineApi.md#gettimelinesummary) | **Post** /timeline/summary | Timeline summary
*TopicApi* | [**Describe**](docs/TopicApi.md#describe) | **Get** /topic/{topic} | Describe a topic
*TopicApi* | [**List**](docs/TopicApi.md#list) | **Get** /topic | List topics
*TopologySynchronizationApi* | [**GetTopologySynchronizationStreamById**](docs/TopologySynchronizationApi.md#gettopologysynchronizationstreambyid) | **Get** /synchronization/topology/streams/sync | Overview of a specific Topology Stream, queried by node id or sync identifier
Expand All @@ -225,6 +226,7 @@ Class | Method | HTTP request | Description
*TracesApi* | [**SuggestionsAttributeName**](docs/TracesApi.md#suggestionsattributename) | **Get** /traces/spans/fields/attributes | Suggestions for attribute names
*TracesApi* | [**SuggestionsAttributeValue**](docs/TracesApi.md#suggestionsattributevalue) | **Get** /traces/spans/fields/attributes/{attributeName}/values | Suggestions for attribute values
*TracesApi* | [**SuggestionsFieldValues**](docs/TracesApi.md#suggestionsfieldvalues) | **Get** /traces/spans/fields/{field}/values | Suggestions for span fields
*UserAuthorizationApi* | [**GetUserAuthorizationFor**](docs/UserAuthorizationApi.md#getuserauthorizationfor) | **Get** /user/authorization/for | Is the current user authorized for the provided permission
*UserProfileApi* | [**GetCurrentUserProfile**](docs/UserProfileApi.md#getcurrentuserprofile) | **Get** /user/profile | Get current user profile
*UserProfileApi* | [**SaveCurrentUserProfile**](docs/UserProfileApi.md#savecurrentuserprofile) | **Put** /user/profile | Save current user profile
*UserSessionApi* | [**GetUserSessionAssumedRole**](docs/UserSessionApi.md#getusersessionassumedrole) | **Get** /user/session/assumedRole | Get the assumed a role for the current session
Expand Down Expand Up @@ -272,6 +274,7 @@ Class | Method | HTTP request | Description
- [ComponentHighlightMetricSectionAllOf](docs/ComponentHighlightMetricSectionAllOf.md)
- [ComponentNotFoundError](docs/ComponentNotFoundError.md)
- [ComponentQuery](docs/ComponentQuery.md)
- [ComponentViewArguments](docs/ComponentViewArguments.md)
- [CreateSubject](docs/CreateSubject.md)
- [DataUnavailable](docs/DataUnavailable.md)
- [DependencyDirection](docs/DependencyDirection.md)
Expand All @@ -289,6 +292,7 @@ Class | Method | HTTP request | Description
- [EventComponent](docs/EventComponent.md)
- [EventCursor](docs/EventCursor.md)
- [EventElement](docs/EventElement.md)
- [EventFilters](docs/EventFilters.md)
- [EventItemsWithTotal](docs/EventItemsWithTotal.md)
- [EventListRequest](docs/EventListRequest.md)
- [EventNotFoundError](docs/EventNotFoundError.md)
Expand Down Expand Up @@ -472,6 +476,7 @@ Class | Method | HTTP request | Description
- [PromVector](docs/PromVector.md)
- [PromVectorResult](docs/PromVectorResult.md)
- [ProvisionResponse](docs/ProvisionResponse.md)
- [QueryViewArguments](docs/QueryViewArguments.md)
- [ReleaseStatus](docs/ReleaseStatus.md)
- [RequestError](docs/RequestError.md)
- [RequestValidationError](docs/RequestValidationError.md)
Expand Down Expand Up @@ -527,6 +532,12 @@ Class | Method | HTTP request | Description
- [TeamsChannelWriteSchema](docs/TeamsChannelWriteSchema.md)
- [TeamsNotificationChannel](docs/TeamsNotificationChannel.md)
- [TeamsNotificationChannelAllOf](docs/TeamsNotificationChannelAllOf.md)
- [TimelineSummary](docs/TimelineSummary.md)
- [TimelineSummaryError](docs/TimelineSummaryError.md)
- [TimelineSummaryEventBucket](docs/TimelineSummaryEventBucket.md)
- [TimelineSummaryHealthChange](docs/TimelineSummaryHealthChange.md)
- [TimelineSummaryRequest](docs/TimelineSummaryRequest.md)
- [TimelineSummaryRequestArguments](docs/TimelineSummaryRequestArguments.md)
- [TooManyActiveQueries](docs/TooManyActiveQueries.md)
- [TooManyTopologyResults](docs/TooManyTopologyResults.md)
- [Topic](docs/Topic.md)
Expand Down
Loading
Loading