Skip to content

Commit

Permalink
Merge pull request #91 from bugsnag/release-v1.3.0
Browse files Browse the repository at this point in the history
Release v1.3.0
  • Loading branch information
robert-smartbear authored Sep 30, 2024
2 parents beb5406 + 129de80 commit 5a2e159
Show file tree
Hide file tree
Showing 47 changed files with 977 additions and 100 deletions.
12 changes: 10 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ steps:
- "--app=/app/features/fixtures/mazerunner/build/ios/ipa/mazerunner.ipa"
- "--farm=bb"
- "--device=IOS_14|IOS_15|IOS_16"
- "--fail-fast"
- "--no-tunnel"
- "--aws-public-ip"
- "--fail-fast"
- "--appium-version=1.22"
test-collector#v1.10.2:
files: "reports/TEST-*.xml"
format: "junit"
branch: "^main|next$$"
concurrency: 25
concurrency_group: 'bitbar'
concurrency_method: eager
Expand Down Expand Up @@ -102,10 +106,14 @@ steps:
- "--app=features/fixtures/mazerunner/build/app/outputs/flutter-apk/app-release.apk"
- "--farm=bb"
- "--device=ANDROID_10|ANDROID_11|ANDROID_12|ANDROID_13"
- "--fail-fast"
- "--no-tunnel"
- "--aws-public-ip"
- "--fail-fast"
- "--appium-version=1.22"
test-collector#v1.10.2:
files: "reports/TEST-*.xml"
format: "junit"
branch: "^main|next$$"
concurrency: 25
concurrency_group: 'bitbar'
concurrency_method: eager
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

## 1.3.0 (2024-09-30)

### Enhancements

* Custom attributes can now be set on a span, including as lists of primitives (int, double, bool, String) [88](https://github.com/bugsnag/bugsnag-flutter-performance/pull/88)

* Introduced OnSpanEndCallbacks that allow changes to spans when their end() method is called, but before they are sent [88](https://github.com/bugsnag/bugsnag-flutter-performance/pull/88)

## 1.2.1 (2024-09-18)

### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.3.0
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ services:
BUILDKITE_REPO:
BUILDKITE_RETRY_COUNT:
BUILDKITE_STEP_KEY:
BUILDKITE_ANALYTICS_TOKEN:
MAZE_BUGSNAG_API_KEY:
MAZE_REPEATER_API_KEY:
MAZE_NO_FAIL_FAST:
ports:
- "9000-9499:9339"
volumes:
- ./features/:/app/features/
- ./maze_output:/app/maze_output
- /var/run/docker.sock:/var/run/docker.sock
- ./reports/:/app/reports/

networks:
default:
Expand Down
1 change: 0 additions & 1 deletion features/fixture_resources/lib/channels.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:flutter/services.dart';

class MazeRunnerChannels {
Expand Down
12 changes: 6 additions & 6 deletions features/fixture_resources/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Command {
}

class MazeRunnerFlutterApp extends StatelessWidget {
const MazeRunnerFlutterApp({Key? key}) : super(key: key);
const MazeRunnerFlutterApp({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -151,9 +151,9 @@ class MazeRunnerHomePage extends StatefulWidget {
final String mazerunnerUrl;

const MazeRunnerHomePage({
Key? key,
super.key,
required this.mazerunnerUrl,
}) : super(key: key);
});

@override
State<MazeRunnerHomePage> createState() => _HomePageState();
Expand Down Expand Up @@ -332,9 +332,9 @@ class _HomePageState extends State<MazeRunnerHomePage> {
height: 400.0,
width: double.infinity,
child: TextButton(
child: const Text("Run Command"),
onPressed: () => _onRunCommand(context),
key: const Key("runCommand"),
child: const Text("Run Command"),
),
),
TextField(
Expand Down Expand Up @@ -373,14 +373,14 @@ class _HomePageState extends State<MazeRunnerHomePage> {
),
),
TextButton(
child: const Text("Start Bugsnag"),
onPressed: _onStartBugsnag,
key: const Key("startBugsnag"),
child: const Text("Start Bugsnag"),
),
TextButton(
child: const Text("Run Scenario"),
onPressed: () => _onRunScenario(context),
key: const Key("startScenario"),
child: const Text("Run Scenario"),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class AutoInstrumentAppStartsScenario extends Scenario {
bugsnag_performance.setExtraConfig("probabilityValueExpireTime", 1000);
bugsnag_performance.start(
apiKey: '12312312312312312312312312312312',
endpoint: Uri.parse(FixtureConfig.MAZE_HOST.toString() + '/traces'));
bugsnag_performance.measureRunApp(() async => await Duration(seconds: 1));
endpoint: Uri.parse('${FixtureConfig.MAZE_HOST}/traces'));
bugsnag_performance.measureRunApp(() async => const Duration(seconds: 1));
setMaxBatchSize(4);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:flutter/material.dart';
import 'package:mazerunner/main.dart';

import 'scenario.dart';

Expand Down Expand Up @@ -68,7 +67,7 @@ class _AutoInstrumentNavigationBasicDeferScenarioScreenState
onTap: () => widget.runCommandCallback(),
);
}
return Text('AutoInstrumentNavigationBasicDeferScenarioScreen');
return const Text('AutoInstrumentNavigationBasicDeferScenarioScreen');
}

void setStage(int stage) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:mazerunner/main.dart';

import 'scenario.dart';

Expand All @@ -15,11 +13,11 @@ class AutoInstrumentNavigationBasicScenario extends Scenario {

@override
Widget? createWidget() {
return Text('AutoInstrumentNavigationBasicScenario');
return const Text('AutoInstrumentNavigationBasicScenario');
}

@override
RouteSettings? routeSettings() {
return RouteSettings(name: 'basic_navigation_scenario');
return const RouteSettings(name: 'basic_navigation_scenario');
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:flutter/material.dart';
import 'package:mazerunner/main.dart';

import 'scenario.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';

import 'package:flutter/material.dart';
import 'package:mazerunner/main.dart';

import 'scenario.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:flutter/material.dart';
import 'package:mazerunner/main.dart';

import 'scenario.dart';

Expand Down Expand Up @@ -62,8 +60,8 @@ class AutoInstrumentNavigationPushAndPopScenarioScreenState
Widget build(BuildContext context) {
return GestureDetector(
child: Container(
child: Text('AutoInstrumentNavigationPushAndPopScenarioScreen'),
color: Colors.white,
child: Text('AutoInstrumentNavigationPushAndPopScenarioScreen'),
),
onTap: () => widget.runCommandCallback(),
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:flutter/material.dart';
import 'package:mazerunner/main.dart';

import 'scenario.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:bugsnag_flutter/bugsnag_flutter.dart';
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:mazerunner/main.dart';

import 'scenario.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:bugsnag_flutter/bugsnag_flutter.dart';
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:mazerunner/main.dart';

import 'scenario.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'scenario.dart';

class CustomAppVersionScenario extends Scenario {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'scenario.dart';

class CustomEnabledReleaseStageScenario extends Scenario {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'scenario.dart';

class CustomReleaseStageScenario extends Scenario {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'scenario.dart';

class CustomServiceNameScenario extends Scenario {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';

import 'scenario.dart';

class CustomSpanAttributesScenario extends Scenario {
@override
Future<void> run() async {
await startBugsnag(onSpanEndCallbacks: [
_setAttributesAndThrow,
_discardUnwantedSpan,
_setAttributes,
]);
setMaxBatchSize(1);
doSimpleSpan('CustomSpanAttributesScenarioDiscaredSpan');
final span =
bugsnag_performance.startSpan('CustomSpanAttributesScenarioSpan');
span.setAttribute('customAttribute1', 42);
span.setAttribute('customAttribute2', 'Test');
span.setAttribute('customAttribute3', 1);
span.end();
span.setAttribute('customAttribute6', 'T');
}

Future<bool> _setAttributesAndThrow(BugsnagPerformanceSpan span) async {
span.setAttribute('customAttribute1', 'C');
throw Exception('');
}

Future<bool> _discardUnwantedSpan(BugsnagPerformanceSpan span) async {
if (span.name == 'CustomSpanAttributesScenarioDiscaredSpan') {
return false;
}
return true;
}

Future<bool> _setAttributes(BugsnagPerformanceSpan span) async {
span.setAttribute('customAttribute3', 2);
span.setAttribute('customAttribute3', 3);
span.setAttribute('customAttribute2', null);
span.setAttribute('customAttribute4', 42.0);
span.setAttribute('customAttribute5', [
'customString',
42,
true,
43.0,
]);
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';

import 'scenario.dart';

class CustomSpanAttributesWithLimitsScenario extends Scenario {
@override
Future<void> run() async {
await startBugsnag(
attributeCountLimit: 8,
attributeStringValueLimit: 20,
attributeArrayLengthLimit: 6,
onSpanEndCallbacks: [
_setAttributes,
]);
setMaxBatchSize(1);
final span = bugsnag_performance
.startSpan('CustomSpanAttributesWithLimitsScenarioSpan');
final tooLongKey = 'a' * 129;
span.setAttribute('customAttribute1', 42);
span.setAttribute(tooLongKey, 'Test');
span.setAttribute('customAttribute2', 1);
span.setAttribute('customAttribute3', [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
span.setAttribute(
'customAttribute4', 'VeryLongStringAttributeValueThatExceedsTheLimit');
span.setAttribute('customAttribute5', 42.0);
span.setAttribute('customAttribute6', 'Dropped');
span.end();
}

Future<bool> _setAttributes(BugsnagPerformanceSpan span) async {
span.setAttribute('customAttribute7', 'Droppedtoo');
span.setAttribute('customAttribute2', 'NotDropped');
return true;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:bugsnag_http_client/bugsnag_http_client.dart';
import 'package:dio/io.dart';
import '../main.dart';
import 'scenario.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:bugsnag_http_client/bugsnag_http_client.dart';
import 'package:dio/io.dart';
import '../main.dart';
import 'scenario.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'scenario.dart';

class DisableCustomReleaseStageScenario extends Scenario {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class HttpClientTracePropagationUrlsScenario extends Scenario {
http.addSubscriber(bugsnag_performance.networkInstrumentation);
http.get(
Uri.parse('${FixtureConfig.MAZE_HOST.toString()}/reflect?dontsend'));
await Future.delayed(Duration(seconds: 1));
await Future.delayed(const Duration(seconds: 1));
http.get(Uri.parse('${FixtureConfig.MAZE_HOST.toString()}/reflect?dosend'));
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import 'dart:convert';

import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'package:mazerunner/main.dart';

import 'scenario.dart';
import 'package:http/http.dart' as http;

class InitialPScenario extends Scenario {
@override
Expand All @@ -15,7 +12,7 @@ class InitialPScenario extends Scenario {
bugsnag_performance.setExtraConfig("probabilityValueExpireTime", 25000);
bugsnag_performance.start(
apiKey: '12312312312312312312312312312312',
endpoint: Uri.parse(FixtureConfig.MAZE_HOST.toString() + '/traces'));
endpoint: Uri.parse('${FixtureConfig.MAZE_HOST}/traces'));
setMaxBatchSize(1);
doSimpleSpan('First');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'scenario.dart';

class ManualSpanScenario extends Scenario {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bugsnag_flutter_performance/bugsnag_flutter_performance.dart';
import 'scenario.dart';

class MaxBatchAgeScenario extends Scenario {
Expand Down
Loading

0 comments on commit 5a2e159

Please sign in to comment.