viewing stackTrace in the UI? - google-cloud-trace

When i try to add a stackTrace to my spans, i get the following results:
Adding stackTrace to a parent span results in an empty "Callstack" section in the UI (parent stackTrace)
Adding stackTrace to a child span results in a "/stackTrace" attribute in the UI. The attribute value is an unformatted json dump that's pretty hard to read (child stackTrace)
Is this the result of calling the API incorrectly or is this what i should expect from this feature?

Related

Opentelemetry context propagation test

I'm trying to test some opentelemetry spans are correctly build and linked in parent child relations.
clientSpan = Span.wrap(
SpanContext.createFromRemoteParent(
"12345678123456781234567812345678",
"1234567812345678",
TraceFlags.getDefault,
TraceState.getDefault
)
)
.updateName("clientSpan")
And the code which I want to test creates a new span which is the child span of the client span which it receives
tracer.spanBuilder("my-endpoint")
.setSpanKind(SpanKind.SERVER)
.setParent(Context.current().`with`(clientSpan))
.startSpan()
My problem is that whenever I pass the clientSpan the
InMemorySpanExporter.getFinishedSpanItems() returns empty.
It returns non-empty and as expected when no clientSpan is used.
In the unit test i tried both ending the parent span or leaving it open: clientSpan.end() but getFinishedSpanItems is always empty.
Maybe I'm not building correctly the clientSpan in my unit test ? (in prod code it gets extracted from the carrier-propagator-getter combo)
The wrap returns a non-recording span that contains the provided span context but has no functionality. All the operations are no-op. So whatever you do clientSpan has no effect.
Please change the TraceFlags.getDefault() to TraceFlags.getSampled(). The default returns a flag with all bit off which means the no child spans will be considered

Application.Current.Properties - System.AggregateException

I'm trying to get some data from Application.Current.Properties storage. Unfortunately, any time I want to use this Dictionary, I see this error:
An exception of type 'System.AggregateException' occurred in mscorlib.ni.dll but was not handled in user code
Additional information: One or more errors occurred.
And in details I found this:
{"Error in line 1 position 206. Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:Value' contains data of the 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:ArrayOfstring' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'ArrayOfstring' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer."}
It seems like I tried to save some non-string data to Application.Current.Properties. Unfortunately I can't run .Clear() method to erease all data, bacause I receive this error any time I'm trying to access this property.
What should I do to make it work?
Well, as its name suggests AggregateException, is just a container for one or more exceptions which may be thrown when using PLINQ or TPL.
As such exceptions may be thrown on different threads and may also occur concurrently, the system automatically catches and rethrows them within an AggregateException wrapper to ensure that they all get reported in one place. The exceptions themselves are exposed via the InnerExceptions property.
You can catch an AggregateException and check which exceptions it actually contains with code such as the following:
try
{
// perform some parallel operation
}
catch (AggregateException aex)
{
string messages = "";
foreach(Exception ex in aex.InnerExceptions)
{
messages += ex.Message + "\r\n";
}
MessageBox.Show(messages);
}
So I suggest you do this to see what is causing the problem
Please, remove your app from your device, Settings - Applications- Uninstall, this works for me. The Auth Object was crash in debug mode.Clean and Rebuild can be Helpfull to.

CodedUI assert a nonexistent element

my problem is that I want to check that an element is not displayed. In other words I want to check that an element was deleted.
So I am developing an automatic test that has a option to disable comments. I want to check that the textfield for the comments is nonexistent. Is there any easy way to do this?
You need to distinguish between the element (a text field or something) being not displayed and it being empty.
If the field is displayed but is empty then a simple assertion that the value is the empty string will work.
If the field is not displayed at all then an attempt on an assertion will fail with a control not found exception. The relevant code can be enclosed within a try-catch block that expects to catch the exception
try {
... access the control...;
Assert.Fail("The control was found but it should not be present.");
}
catch (UITestControlNotFoundException ) {
// Success path.
}
Make sure that the ... access the control...; checks for the correct level in thy control hierarchy. You may also want to enclose it with code to fail quickly when the control is not present, by default Coded UI may wait in case the application is slow to draw the control.
Try this :
Bool isExists = (Boolean)BrowserWindow.ExecuteScript("return $('#yourcontrolId').length > 0;");
if(isExists)
Assert.Fail("Control is not deleted");
// Success Code

BIRT Reporting: how to access LinkedHashMap in script

While creating BIRT Report, I'm trying to access a LinkedHashMap in report beforeFactory event thro' rhino scripting..Able to print the map. But, when i use any method like size(), the following error is thrown
size not found
var test1 = reportVO.getTest(); // "test" is a LinkedHashMap
log(test1) // --> In the logs, im able to see the LinkedHashMap contents printed
(log test1.size()) // --> this fails.
I have imported the util package.
I read about org.eclipse.birt.core.script.NativeJavaLinkedHashMap. I tried accessing the LinkedHashMap thro' methods of this class also, like
test1.getIds() // Method from NativeJavaLinkedHashMap --> this fails too
getIds not found
Is there a specific way to access LinkedhashMap in script.
Thanks,
Vishnupriya
Did you used test1.length ? you are now accessing javascript variable instead of java variable
For More Click Here

ASPxGridView page works for some users, not for others. WebForm model using C#, ASP, SQL Express

I am debugging a website built on the WebForms model, using ASP, C# as codebehind, and SQL Express 2008 R2. I am trying to debug a page that uses an ASPxGridView, which is populated from the .aspx file, and the dataset is uses is created there as well. The data is selected using
SelectCommand="SELECT MachineID, ProgramNo, (CONVERT (VARCHAR(19), Start, 120)) as Start,(CONVERT (VARCHAR(12), Stop,114)) as StopTime, WorkCount, PartCount as TotalWorkCount,(CONVERT (VARCHAR(12), Stop-start,114)) as PartCycle FROM Program WHERE (MachineID = #MachineID) AND (WorkCount > 0) AND (CONVERT (VARCHAR(19), Start, 120) >= #StartDate) AND (CONVERT (VARCHAR(10), Start, 120) <= #EndDate) order by Start Desc">
The problem is that most users can login and the page works perfectly, but a few users see the following error in the web browser:
A field or property with name 'PartCycle' was not found in the selected data source. Possible causes of this error may be the following: an incorrect or case-insensitive spelling of the grid column name; assigning a wrong or not properly initialized data source to the grid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A field or property with name 'PartCycle' was not found in the selected data source. Possible causes of this error may be the following: an incorrect or case-insensitive spelling of the grid column name; assigning a wrong or not properly initialized data source to the grid.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): A field or property with name 'PartCycle' was not found in the selected data source. Possible causes of this error may be the following: an incorrect or case-insensitive spelling of the grid column name; assigning a wrong or not properly initialized data source to the grid.]
DevExpress.Web.Data.WebDataControllerProvider.GetRowValueByControllerRow(Int32 controllerRow, String fieldName, Boolean isDesignTime) +300
DevExpress.Web.Data.WebDataControllerProvider.GetRowValue(Int32 visibleIndex, String fieldName, Boolean isDesignTime) +203
DevExpress.Web.Data.WebDataProxy.GetRowValue(Int32 visibleIndex, String fieldName) +77
As you can see, PartCycle is not a column in the tables, but is used as an alias for (CONVERT (VARCHAR(12), Stop-start,114)). To put a twist in the plot, I can view the problem data just fine when I am logged into the site as an Administrator. The users who see this error have various ASPNET Roles, but each have access to the data in the tables selected.
Its because ASPxGridView Caches the Columns.
In your case, your datasource is dynamic i.e. different for different users.
Make sure to Clear the Columns before binding ASPxGridView.
To Clear the Columns:
agvObject.Columns.Clear();

Resources