Monthly Archives: September 2017

Access all of your data with Data Studio Community Connectors

Since the recent developer launch of Data Studio Community Connectors, users have been able to easily connect to and report on data from over 250 new sources.

Partners are also now leveraging Data Studio + Community Connectors as a free and powerful reporting and analysis solution for their customers, with minimal development investment.

We’ve already seen a number of interesting use cases. For example, ClickInsight, a Data Studio certified partner, used Community Connectors to create interactive experiences for the weather forecast in Toronto, the NY Times most popular stories, and real time departures info for the Bay Area Rapid Transit system. They embedded these Data Studio reports in a blog post for anyone to try, Are You Ready to Get Creative with Data Studio Connectors?

Try Community Connectors

We have been working with a growing number of partners that are making it easy for users to directly access all of their data in Data Studio. Partners such as AdStage, Analytics Canvas, CallRail, data.world, Funnel, PowerMyAnalytics, and Supermetrics have enabled easy access to 250 data sets including: Facebook Ads, MailChimp, LinkedIn, Instagram, Pinterest, Reddit, Amazon, and many more available through the Community Connector Gallery.


Data Studio Community Connectors Gallery

Easily build your own Community Connector

You can develop your own Community Connectors and use them in Data Studio reports and dashboards. Your connector can fetch data from sources such as:

We’ve made it easy to build your own connector by leveraging the Google Apps Script platform which provides a multitude of services and resources to quickly build and deploy connectors. 

To learn more about building a Community Connector visit Getting Started with Community Connectors and the Community Connector Developer Program.


Share, publish or open-source your Community Connector

The reports you create using Community Connectors can be shared with others. In addition, you can let other Data Studio users use your connector. For example, you can directly share your connector with colleagues at your organization or make your connector available for all Data Studio users to find by publishing your connector in the Community Connector Gallery.


Tell us your story

If you have any interesting connector stories, ideas or if you’d like to share some amazing reports you’ve created using Community Connectors please let us know by giving us a shout or send us your story at [email protected].

As we continue to improve the Community Connector features be sure to regularly check the Community Connector Gallery for new additions that will enable greater access to all of your data in Data Studio.

Posted by Pete Frisella, on behalf of the entire Data Studio team

The more things change, the more the pastrami stays the same: a Talks at Google roundup

As the seasons change, we started thinking about other types of change. This month’s Talks at Google roundup delves into everything from changing habits to how two famous Jewish delis balance classic dishes amidst a changing food scene.

Author, podcaster and expert habit-former Gretchen Rubin talks about “Better Than Before,” her book that offers a new perspective on habits. She explains how to form habits, why we break them, and the four types of habit tendencies.

Gretchen Rubin's Talk at Google

Bollywood star Farhan Akhtar wanted to do something about the mounting violence against women in the world. He shares how he used creative arts to create social change, and talks about his creative process along the way.

Farhan Akhtar's Talk at Google

Hear from Matthew Claudel—author of “City of Tomorrow”—whose job is to imagine the future of cities, and how technology is changing that future.

Matthew Claudel's Talk at Google

Jennifer Brown, author of “Inclusion: Diversity, the New Workplace & the Will to Change,” shares her strategies for empowering employees and harnessing the power of diversity in today’s ever-changing world of business.

Jennifer Brown's Talk at Google

Disclaimer: this one might make you hungry. Jake Dell (owner of Katz’s Deli in New York) and Evan Bloom (co-owner of Wise Sons Deli in San Francisco) chat about the evolution of the Jewish deli, and how they maintain tradition while staying current (especially when it comes to pastrami sandwiches). They may not be in lox-step in their approach to food, but we think you’ll like this talk a latke.

The Evolution of the Jewish Deli

The High Five: insights on the top search trends of the week

This week people searched for free coffee, the death of a media mogul, help with IKEA tasks and new wheels from Ford. And as Puerto Rico reels from the devastation of Hurricane Maria, people want to know how they can help. Here are the top trends of the week, with data from Google News Lab.

Hurricane Maria

Puerto Rico continues to grapple with the aftermath of Hurricane Maria, which left many without power and desperate for food, electricity and communication services. People in the U.S. continue to search for “hurricane donation” (interest went up 185% this week), as well as “How powerful was Hurricane Maria?” “How to donate to Puerto Rico” and “What is the Jones Act?” (A law that was waived to get relief to Puerto Rico quicker). The top regions searching for Puerto Rico were Florida, Connecticut and New Jersey.

Caffeine fiends

Wake up and smell the coffee—it’s National Coffee Day! And everyone is after the free java, with searches like, “Is Starbucks doing anything for National Coffee Day?” “Who gives free coffee on National Coffee Day?” and “What is National Coffee Day at Dunkin Donuts?” Cold brew coffee, butter coffee, and Irish coffee (for those starting early…) are the most searched types of coffee this week.

RIP Hef

Hugh Hefner passed away this week at the age of 91. Upon hearing the news, people searched to find out more about Hefner’s fortune and infamous love life: “How much was Hugh Hefner worth?” “Who gets Hugh Hefner’s money?” and “Who was Hugh Hefner married to?” Hefner will be buried next to Marilyn Monroe, Playboy’s first cover girl (search interest in Monroe went up 570% this week as well).

But will they assemble the meatballs, too?

This week, two of the top searched questions about IKEA were: “How to build IKEA Tarva nightstand” and “How to remove IKEA drawer front.” Well, now you can get some help with that. This week, IKEA closed a deal to buy the online errand company TaskRabbit so that the dreaded phrase “assembly required” will become slightly less scary. Those who are keen on IKEA are searching the most for dressers, desks, rugs, kitchen cabinets and beds.

Riding in style

Ford is getting revved up with its new F-450 Super Duty Limited truck, which can cost as much as $100,000 and tows 15 tons … talk about luxury. Search interest for the new truck went into overdrive—“Ford Truck” was searched 2000% more than “Ford SUV.” People are doing their due diligence on the Super Duty, searching “Where is the F-250 Super Duty made?” “What is the MPG of a Ford Super Duty Diesel?” and “What roof bars fit a Ford Super Duty?”

The High Five: insights on the top search trends of the week

This week people searched for free coffee, the death of a media mogul, help with IKEA tasks and new wheels from Ford. And as Puerto Rico reels from the devastation of Hurricane Maria, people want to know how they can help. Here are the top trends of the week, with data from Google News Lab.

Hurricane Maria

Puerto Rico continues to grapple with the aftermath of Hurricane Maria, which left many without power and desperate for food, electricity and communication services. People in the U.S. continue to search for “hurricane donation” (interest went up 185% this week), as well as “How powerful was Hurricane Maria?” “How to donate to Puerto Rico” and “What is the Jones Act?” (A law that was waived to get relief to Puerto Rico quicker). The top regions searching for Puerto Rico were Florida, Connecticut and New Jersey.

Caffeine fiends

Wake up and smell the coffee—it’s National Coffee Day! And everyone is after the free java, with searches like, “Is Starbucks doing anything for National Coffee Day?” “Who gives free coffee on National Coffee Day?” and “What is National Coffee Day at Dunkin Donuts?” Cold brew coffee, butter coffee, and Irish coffee (for those starting early…) are the most searched types of coffee this week.

RIP Hef

Hugh Hefner passed away this week at the age of 91. Upon hearing the news, people searched to find out more about Hefner’s fortune and infamous love life: “How much was Hugh Hefner worth?” “Who gets Hugh Hefner’s money?” and “Who was Hugh Hefner married to?” Hefner will be buried next to Marilyn Monroe, Playboy’s first cover girl (search interest in Monroe went up 570% this week as well).

But will they assemble the meatballs, too?

This week, two of the top searched questions about IKEA were: “How to build IKEA Tarva nightstand” and “How to remove IKEA drawer front.” Well, now you can get some help with that. This week, IKEA closed a deal to buy the online errand company TaskRabbit so that the dreaded phrase “assembly required” will become slightly less scary. Those who are keen on IKEA are searching the most for dressers, desks, rugs, kitchen cabinets and beds.

Riding in style

Ford is getting revved up with its new F-450 Super Duty Limited truck, which can cost as much as $100,000 and tows 15 tons … talk about luxury. Search interest for the new truck went into overdrive—“Ford Truck” was searched 2000% more than “Ford SUV.” People are doing their due diligence on the Super Duty, searching “Where is the F-250 Super Duty made?” “What is the MPG of a Ford Super Duty Diesel?” and “What roof bars fit a Ford Super Duty?”

Source: Search


Introducing Network Policy support for Google Container Engine, with Project Calico and Tigera



[Editor’s Note: Today we announced the beta of Kubernetes Network Policy in Google Container Engine, a feature we implemented in close collaboration with our partner Tigera, the company behind Project Calico. Read on for more details from Tigera co-founder and vice president of product, Andy Randall.]

When it comes to network policy, a lot has changed. Back in the day, we protected enterprise data centers with a big expensive network appliance called a firewall that allowed you to define rules about what traffic to allow in and out of the data center. In the cloud world, virtual firewalls provide similar functionality for virtual machines. For example, Google Compute Engine allows you to configure firewall rules on VPC networks.

In a containerized microservices environment such as Google Container Engine, network policy is particularly challenging. Traditional firewalls provide great perimeter security for intrusion from outside the cluster (i.e. “north-south” traffic), but aren’t designed for “east-west” traffic within the cluster at a finer-grained level. And while Container Engine automates the creation and destruction of containers (each with its own IP address), not only do you have many more IP endpoints than you used to, the automated create-run-destroy life-cycle of a container can result in churn up to 250x that of virtual machines.

Traditional firewall rules are no longer sufficient for containerized environments; we need a more dynamic, automated approach that is integrated with the orchestrator. (For those interested in why we can’t just continue with traditional virtual network / firewall approaches, see Christopher Liljenstolpe’s blog post, Micro-segmentation in the Cloud Native World.)


We think the Kubernetes Network Policy API and the Project Calico implementation present a solution to this challenge. Given Google’s leadership role in the community, and its commitment to running Container Engine on the latest Kubernetes release, it’s only natural that they would be the first to include this capability in their production hosted Kubernetes service, and we at Tigera are delighted to have helped support this effort.


Kubernetes Network Policy 1.0

What exactly does Kubernetes Network Policy let you do? Kubernetes Network Policy allows you to easily specify the connectivity allowed within your cluster, and what should be blocked. (It is a stable API as of Kubernetes v1.7.)

You can find the full API definition in the Kubernetes documentation but the key points are as follows:
  • Network policies are defined by the NetworkPolicy resource type. These are applied  to the Kubernetes API server like any other resource (e.g., kubectl apply -f my-network-policy.yaml).
  • By default, all pods in a namespace allow unrestricted access. That is, they can accept incoming network connections from any source.
  • A NetworkPolicy object contains a selector expression (“podSelector”) that selects a set of pods to which the policy applies, and the rules about which incoming connections will be allowed (“ingress” rules). Ingress rules can be quite flexible, including their own namespace selector or pod selector expressions.
  • Policies apply to a namespace. Every pod in that namespace selected by the policy’s podSelector will have the ingress rules applied, so any connection attempts that are not explicitly allowed are rejected. Calico enforces this policy extremely efficiently using iptables rules programmed into the underlying host’s kernel. 


Here is an example NetworkPolicy resource to give you a sense of how this all fits together:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: test-network-policy
spec:
  podSelector:
    matchLabels:
      role: db
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          project: myproject
    - podSelector:
        matchLabels:
          role: frontend
    ports:
    - protocol: TCP
      port: 6379


In this case, the policy is called “test-network-policy” and applies to the default namespace. It restricts inbound connections to every pod in the default namespace that has the label “role: db” applied. The selectors are disjunctive, i.e., either can be true. That means that connections can come from any pod in a namespace with label “project: myproject”, OR any pod in the default namespace with the label “role: frontend”. Further, these connections must be on TCP port 6379 (the standard port for Redis).

As you can see, Network Policy is an intent-based policy model, i.e., you specify your desired end-state and let the system ensure it happens. As pods are created and destroyed, or a label (such as “role: db”) is applied or deleted from existing pods, you don’t need to update anything: Calico automatically takes care of things behind the scenes and ensures that every pod on every host has the right access rules applied.

As you can imagine, that’s quite a computational challenge at scale, and Calico’s policy engine contains a lot of smarts to meet Container Engine’s production performance demands. The good news is that you don’t need to worry about that. Just apply your policies and Calico takes care of the rest.


Enabling Network Policy in Container Engine

For new and existing clusters running at least Kubernetes v1.7.6, you can enable network policy on Container Engine via the UI, CLI or API. For new clusters, simply set the flag (or check the box in the UI) when creating the cluster. For existing clusters there is a two-step process:
  1. Enable the network policy add-on on the master.
  2. Enable network policy for the entire cluster’s node-pools.
Here’s how to do that during cluster creation:

# Create a cluster with Network Policy Enabled
gcloud beta container clusters create <CLUSTER> --project=<PROJECT_ID> 
--zone=&ltZONE> --enable-network-policy --cluster-version=1.7.6


Here’s how to do it for existing clusters:
# Create a cluster with Network Policy Enabled

# Enable the addon
gcloud beta container clusters update <CLUSTER> --project=<PROJECT_ID> 
--zone=<ZONE>--update-addons=NetworkPolicy=ENABLE

# Enable on nodes (This re-creates the node pools)
gcloud beta container clusters update <CLUSTER> --project=<PROJECT_ID> 
--zone=<ZONE> --enable-network-policy

Looking ahead 

Environments running Kubernetes 1.7 can use the NetworkPolicy API capabilities that we discussed above, essentially ingress rules defined by selector expressions. However, you can imagine wanting to do more, such as:

  • Applying egress rules (restricting which outbound connections a pod can make) 
  • Referring to IP addresses or ranges within rules 

The good news is that the new Kubernetes 1.8 includes these capabilities, and Google and Tigera are working together to make them available in Container Engine. And, beyond that, we are working on even more advanced policy capabilities. Watch this space!

Attend our joint webinar! 

Want to learn more? Google Product Manager Matt DeLio will join Casey Davenport, the Kubernetes Networking SIG leader and a software engineer at Tigera, to talk about best practices and design patterns for securing your applications with network policy. Register here for the October 5th webinar.

Google Container Engine – Kubernetes 1.8 takes advantage of the cloud built for containers



Next week, we will roll out Kubernetes 1.8 to Google Container Engine for early access customers. In addition, we are advancing significant new functionality in Google Cloud to give Container Engine customers a great experience across Kubernetes releases. As a result, Container Engine customers get new features that are only available on Google Cloud Platform, for example highly available clusters, cluster auto-scaling and auto-repair, GPU hardware support, container-native networking and more.

Since we founded Kubernetes back in 2014, Google Cloud has been the leading contributor to the Kubernetes open source project in every release including 1.8. We test, stage and roll out Kubernetes on Google Cloud, and the same team that writes it, supports it, ensuring you receive the latest innovations faster without risk of compatibility breaks or support hassles.

Let’s take a look at the new Google Cloud enhancements that make Kubernetes run so well.

Speed and automation 

Earlier this week we announced that Google Compute Engine, Container Engine and many other GCP services have moved from per-minute to per-second billing. We also lowered the minimum run charge to one minute from 10 minutes, giving you even finer granularity so you only pay for what you use.

Many of you appreciate how quickly you can spin up a cluster on Container Engine. We’ve made it even faster - improving cluster startup time by 45%, so you’re up and running faster, and better able to take advantage of the pricing minimum-time charge. These improvements also apply to scaling your existing node pools.

A long-standing ask has been high availability masters for Container Engine. We are pleased to announce early access support for high availability, multi-master Container Engine clusters, which increase our SLO to 99.99% uptime. You can elect to run your Kubernetes masters and nodes in up to three zones within a region for additional protection from zonal failures. Container Engine seamlessly shifts load away from failed masters and nodes when needed. Sign up here to try out high availability clusters.

In addition to speed and simplicity, Container Engine automates Kubernetes in production, giving developers choice, and giving operators peace of mind. We offer several powerful Container Engine automation features:

  • Node Auto-Repair is in beta and opt-in. Container Engine can automatically repair your nodes using the Kubernetes Node Problem Detector to find common problems and proactively repair nodes and clusters. 
  • Node Auto-Upgrade is generally available and opt-in. Cluster upgrades are a critical Day 2 task and to give you automation with full control, we now offer Maintenance Windows (beta) to specify when you want Container Engine to auto-upgrade your masters and nodes. 
  • Custom metrics on the Horizontal Pod Autoscaler will soon be in beta so you can scale your pods on metrics other than CPU utilization. 
  • Cluster Autoscaling is generally available with performance improvements enabling up to 1,000 nodes, with up to 30 pods in each node as well as letting you specify a minimum and maximum number of nodes for your cluster. This will automatically grows or shrinks your cluster depending on workload demands. 

Container-native networking - Container Engine exclusive! - only on GCP

Container Engine now takes better advantage of GCP’s unique, software-defined network with first-class Pod IPs and multi-cluster load balancing.

  • Aliased IP support is in beta. With aliased IP support, you can take advantage of several network enhancements and features, including support for connecting Container Engine clusters over a Peered VPC. Aliased IPs are available for new clusters only; support for migrating existing clusters will be added in an upcoming release. 
  • Multi-cluster ingress will soon be in alpha. You will be able to construct highly available, globally distributed services by easily setting up Google Cloud Load Balancing to serve your end users from the closest Container Engine cluster. To apply for access, please fill out this form
  • Shared VPC support will soon be in alpha. You will be able to create Container Engine clusters on a VPC shared by multiple projects in your cloud organization. To apply for access, please fill out this form


Machine learning and hardware acceleration

Machine learning, data analytics and Kubernetes work especially well together on Google Cloud. Container Engine with GPUs turbocharges compute-intensive applications like machine learning, image processing, artificial intelligence and financial modeling. This release brings you managed CUDA-as-a-Service in containers. Big data is also better on Container Engine with new features that make GCP storage accessible from Spark on Kubernetes.

  • NVIDIA Tesla P100 GPUs are available in alpha clusters. In addition to the NVIDIA Tesla K80, you can now create a node with up to 4 NVIDIA P100 GPUs. P100 GPUs can accelerate your workloads by up to 10x compared to the K80! If you are interested in alpha testing your CUDA models in Container Engine, please sign up for the GPU alpha
  • Cloud Storage is now accessible from Spark. Spark on Kubernetes can now communicate with Google BigQuery and Google Cloud Storage as data sources and sinks from Spark using bigdata-interop connectors
  • CronJobs are now in beta so you can now schedule cron jobs such as data processing pipelines to run on a given schedule in your production clusters! 

Extensibility 

As more enterprises use Container Engine, we are actively improving extensibility so you can match Container Engine to your environment and standards.


Security and reliability 

We designed Container Engine with enterprise security and reliability in mind. This release adds several new enhancements.

  • Role Based Access Control (RBAC) is now generally available. This feature allows a cluster administrator to specify fine-grained policies describing which users, groups, and service accounts are allowed to perform which operations on which API resources. 
  • Network Policy Enforcement using Calico is in beta. Starting from Kubernetes 1.7.6, you can help secure your Container Engine cluster with network policy pod-to-pod ingress rules. Kubernetes 1.8 adds additional support for CIDR-based rules, allowing you to whitelist access to resources outside of your Kubernetes cluster (e.g., VMs, hosted services, and even public services), so that you can integrate your Kubernetes application with other IT services and investments. Additionally, you can also now specify pod-to-pod egress rules, providing tighter controls needed to ensure service integrity. Learn more about here
  • Node Allocatable is generally available. Container Engine includes the Kubernetes Node Allocatable feature for more accurate resource management, providing higher node stability and reliability by protecting node components from out-of-resource issues. 
  • Priority / Preemption is in alpha clusters. Container Engine implements Kubernetes Priority and Preemption so you can associate priority pods to priority levels such that you can preempt lower-priority pods to make room for higher-priority ones when you have more workloads ready to run on the cluster than there are resources available. 

Enterprise-ready container operations - monitoring and management designed for Kubernetes 

In Kubernetes 1.7, we added view-only workload, networking, and storage views to the Container Engine user interface. In 1.8, we display even more information, enable more operational and development tasks without having to leave the UI, and improve integration with Stackdriver and Cloud Shell.



The following features are all generally available:

  • Easier configurations: You can now view and edit your YAML files directly in the UI. We also added easy to use shortcuts for the most common user actions like rolling updates or scaling a deployment.
  • Node information details: Cluster view now shows details such as node health status, relevant logs, and pod information so you can easily troubleshoot your clusters and nodes. 
  • Stackdriver Monitoring integration: Your workload views now include charts showing CPU, memory, and disk usage. We also link to corresponding Stackdriver pages for a more in-depth look. 
  • Cloud Shell integration: You can now generate and execute exact kubectl commands directly in the browser. No need to manually switch context between multiple clusters and namespaces or copy and paste. Just hit enter! 
  • Cluster recommendations: Recommendations in cluster views suggest ways that you can improve your cluster, for example, turning on autoscaling for underutilized clusters or upgrading nodes for version alignment. 

In addition, Audit Logging is available to early access customers. This features enables you to view your admin activity and data access as part of Cloud Audit Logging. Please complete this form to take part in the Audit Logging early access program.


Container Engine everywhere 

Container Engine customers are global. To keep up with demand, we’ve expanded our global capacity to include our latest GCP regions: Frankfurt (europe-west3), Northern Virginia (us-east4) and São Paulo (southamerica-east1). With these new regions Container Engine is now available in a dozen locations around the world, from Oregon to Belgium to Sydney.



Customers of all sizes have been benefiting from containerizing their applications and running them on Container Engine. Here are a couple of recent examples:

Mixpanel, a popular product analytics company, processes 5 trillion data points every year. To keep performance high, Mixpanel uses Container Engine to automatically scale resources.

“All of our applications and our primary database now run on Google Container Engine. Container Engine gives us elasticity and scalable performance for our Kubernetes clusters. It’s fully supported and managed by Google, which makes it more attractive to us than elastic container services from other cloud providers,” says Arya Asemanfar, Engineering Manager at Mixpanel. 

RealMassive, a provider of real-time commercial real estate information, was able to cut its cloud hosting costs in half by moving to microservices on Container Engine.

“What it comes down to for us is speed-to-market and cost. With Google Cloud Platform, we can confidently release services multiple times a day and launch new markets in a day. We’ve also reduced our cloud hosting costs by 50% by moving to microservices on Google Container Engine,” says Jason Vertrees, CTO at RealMassive. 

Bitnami, an application package and deployment platform, shows you how to use Container Engine networking features to create a private Kubernetes cluster that enforces service privacy so that your services are available internally but not to the outside world.

Try it today! 

In a few days, all Container Engine customers will have access to Kubernetes 1.8 in alpha clusters. These new updates will help even more businesses run Kubernetes in production to get the most from their infrastructure and application delivery. If you want to be among the first to access Kubernetes 1.8 on your production clusters, please join our early access program.

You can find the complete list of new features in the Container Engine release notes. For more information, visit our website or sign-up for our free trial at no cost.

PHP 7.1 for Google App Engine is generally available



Earlier this year, we announced PHP 7.1 Google App Engine in beta. We PHP lovers at Google are proud to announce that PHP 7.1 is now generally available on Google App Engine, our easy-to-use platform for building, deploying, managing and automatically scaling services on Google’s infrastructure. The PHP 7.1 runtime is available for App Engine flexible environment.



Along with achieving general availability for PHP 7.1, the new PHP runtime includes a few exciting new features.

Extension enabler


The list of PHP extensions you can use with the App Engine runtime now includes any PHP extension that is stable (1.0 and above) and does not require a EULA. You can find a complete list on the PHP runtime page.

This is great news, but to make it even better you can now quickly and easily activate any of these extensions in your deployment by requiring them with Composer.

composer require "ext-gd:*" --ignore-platform-reqs

This is equivalent to adding the name of the extension, prefixed with “ext-”, to your application’s composer.json:
{
    "require": {
        "ext-gd": "*"
    }
}

You can still install a custom extension or a specific version of a supported extension, but this will require extending the PHP runtime.

Stackdriver Logging and Error Reporting support


Logging to Stackdriver from your PHP application is very simple. The first requirement is to install the Composer package google/cloud version 0.33 or higher.

composer require google/cloud

Now set enable_stackdriver_integration to true in the runtime_config section of app.yaml:

runtime_config:
  enable_stackdriver_integration: true

This configuration tells the PHP runtime to dispatch the batch-processing daemon to handle your logs behind the scenes. This ensures that when your application writes a log, calls to the Stackdriver API happen in another process so as not to add latency to your application.
Now you can create a PsrBatchLogger instance in your code and log to Stackdriver:

use Google\Cloud\Logging\LoggingClient;
use Psr\Log\LogLevel;

$batchLogger = LoggingClient::psrBatchLogger('app'); // logName `app`

// You now have a PSR-3 compliant logger!

$batchLogger->log(LogLevel::DEBUG, 'This is a debug log');
$batchLogger->debug('This is a debug log'); // The same thing

Additionally, the enable_stackdriver_integration flag sets up an auto-prepend file for error reporting. This means uncaught exceptions and fatal errors are formatted and visible in Cloud Console Error Reporting!

throw new \Exception('Uncaught exceptions are logged to Stackdriver!');


$obj->thisDoesNotExist(); // Fatal errors are also logged to Stackdriver!

If you’d rather use individual Google Cloud packages, ensure you have both google/cloud-logging and google/cloud-error-reporting installed. When installing locally, use --ignore-platform-reqs or install gRPC according to the installation instructions.


composer require google/cloud-logging google/cloud-error-reporting \

    "ext-grpc:*" --ignore-platform-reqs

Stackdriver Logging for Laravel

After you’ve configured the enable_stackdriver_integration, you can enable Stackdriver integration in an app based on the Laravel PHP framework by modifying bootstrap/app.php:

// Add `Use` for logging libs
use Google\Cloud\Logging\LoggingClient;
use Monolog\Handler\PsrHandler;

// ... other code

// Just before returning $app
if (isset($_SERVER['GAE_SERVICE'])) {
    $app->configureMonologUsing(function ($monolog) {
        $logger = LoggingClient::psrBatchLogger('app');
        $handler = new PsrHandler($logger);
        $monolog->pushHandler($handler);
    });
}

return $app;

For Error Reporting, add an import and call our `exceptionHandler` in the `report` function in `app/Exceptions/Handler.php`:


use Google\Cloud\ErrorReporting\Bootstrap;

// .. other code
    public function report(Exception $exception)
    {
        if (isset($_SERVER['GAE_SERVICE'])) {
            Bootstrap::exceptionHandler($exception);<
        } else {
            parent::report($exception);
        }
    }

That's it! The logs are sent to Stackdriver Logging with the logName 'app'. Unhandled exceptions are sent to the logName 'app-error', and will show up in Stackdriver Error Reporting.

gRPC Support

Google’s highly performant RPC protocol gRPC is built right into the PHP runtime. This allows you to quickly get started making calls to Cloud Spanner and other gRPC-specific APIs. You can enable the extension in composer.json and download the client library:

composer require "ext-grpc:*" google/cloud-spanner --ignore-platform-reqs

Now you can make calls to Spanner in your application:

<?php
// index.php

require __DIR__ . '/vendor/autoload.php';

$spanner = new Google\Cloud\Spanner\SpannerClient();
$instance = $spanner->instance('YOUR_INSTANCE_ID');
$database = $instance->database('YOUR_DATABASE_ID');

# Execute a simple SQL statement.
echo $database->execute('SELECT "Hello Spanner" as test');

By replacing YOUR_INSTANCE_ID and YOUR_DATABASE_ID with the proper values, your application now displays the text “Hello Spanner”!

Our commitment to PHP and open source

At Google, we’re committed to open source -- and that goes for the new core PHP Docker runtime, google-cloud composer package and Google API client:


We’re thrilled to welcome PHP developers to Google Cloud Platform, and we’re invested in making you as productive as possible. This is just the start -- stay tuned to the blog and our GitHub repositories to catch the next wave of PHP support on GCP.

We can’t wait to hear from you. Feel free to reach out to us on Twitter, or request an invite to the Google Cloud Slack community and join the #PHP channel.

Working together to combat terrorists online

Last week Google hosted a regional event in Jakarta exploring how ‘counter narratives’ can be used to prevent extremism.  Counter narratives can be described as responses to extremist ideas or propaganda and can take many forms.  The discussions extended to far right extremism and experiences using counter narratives within this community as well as the definition of extremism.
At the event there was strong representation from Australia with YouTube content creators, civil society groups, academics and policy makers joining the conversation. There was an unanimous agreement that none of us can address this challenge on our own - we need to come together in fora such as the one in Jakarta to share information and ideas; and explore opportunities where we can actively collaborate or support each other’s activities.  We look forward to continuing these conversations over the coming months, including within the Global Internet Forum to Counter Terrorism that Kent Walker, our Global General Counsel, describes below.


[Editor’s note: This is a revised and abbreviated version of a speech Kent delivered at the United Nations in New York City, NY, on behalf of the members of the Global Internet Forum to Counter Terrorism.]

The Global Internet Forum to Counter Terrorism is a group of four technology companies—Facebook, Microsoft, Twitter, and YouTube—that are committed to working together and with governments and civil society to address the problem of online terrorist content.
For our companies, terrorism isn’t just a business concern or a technical challenge. These are deeply personal threats. We are citizens of London, Paris, Jakarta, and New York. And in the wake of each terrorist attack we too frantically check in on our families and co-workers to make sure they are safe. We’ve all had to do this far too often.
The products that our companies build lower barriers to innovation and empower billions of people around the world. But we recognize that the internet and other tools have also been abused by terrorists in their efforts to recruit, fundraise, and organize. And we are committed to doing everything in our power to ensure that our platforms aren't used to distribute terrorist material.
The Forum’s efforts are focused on three areas: leveraging technology, conducting research on patterns of radicalization and misuse of online platforms, and sharing best practices to accelerate our joint efforts against dangerous radicalization. Let me say more about each pillar.
First, when it comes to technology, you should know that our companies are putting our best talent and technology against the task of getting terrorist content off our services. There is no silver bullet when it comes to finding and removing this content, but we’re getting much better.
One early success in collaboration has been our “hash sharing” database, which allows a company that discovers terrorist content on one of their sites to create a digital fingerprint and share it with the other companies in the coalition, who can then more easily detect and review similar content for removal.
We have to deal with these problems at tremendous scale. The haystacks are unimaginably large and the needles are both very small and constantly changing. People upload over 400 hours of content to YouTube every minute. Our software engineers have spent years developing technology that can spot certain telltale cues and markers. In recent months we have more than doubled the number of videos we've removed for violent extremism and have located these videos twice as fast. And what’s more, 75 percent of the violent extremism videos we’ve removed in recent months were found using technology before they received a single human flag.
These efforts are working. Between August 2015 and June 2017, Twitter suspended more than 935,000 accounts for the promotion of terrorism. During the first half of 2017, over 95 percent of the accounts it removed were detected using its in-house technology. Facebook is using new advances in artificial intelligence to root out "terrorist clusters" by mapping out the pages, posts, and profiles with terrorist material and then shutting them down.
Despite this recent progress, machines are simply not at the stage where they can replace human judgment. For example, portions of a terrorist video in a news broadcast might be entirely legitimate, but a computer program will have difficulty distinguishing documentary coverage from incitement.
The Forum’s second pillar is focused on conducting and sharing research about how terrorists use the internet to influence their audiences so that we can stay one step ahead.
Today, the members of the Forum are pleased to announce that we are making a multi-million dollar commitment to support research on terrorist abuse of the internet and how governments, tech companies, and civil society can fight back against online radicalization.
The Forum has also set a goal of working with 50 smaller tech companies to help them better tackle terrorist content on their platforms. On Monday, we hosted dozens of companies for a workshop with our partners under the UN Counter Terrorism Executive Directorate. There will be a workshop in Brussels in December and another in Indonesia in the coming months. And we are also working to expand the hash-sharing database to smaller companies.
The Forum’s final pillar is working together to find powerful messages and avenues to reach out to those at greatest risk of radicalization.
Members of the forum are doing a better job of sharing breakthroughs with each other. One success we’ve seen is with the Redirect Method developed at Alphabet’s Jigsaw group. Redirect uses targeted advertising to reach people searching for terrorist content and presents videos that undermine extremist recruiting efforts. During a recent eight-week study more than 300,000 users clicked on our targeted ads and watched more than 500,000 minutes of video. This past April, Microsoft started a similar program on Bing. And Jigsaw and Bing are now exploring a partnership to share best practices and expertise.
At the same time, we’re elevating the voices that are most credible in speaking out against terrorism, hate, and violence. YouTube’s Creators for Change program highlights online stars taking a stand against xenophobia and extremism. And Facebook's P2P program has brought together more than 5,000 students from 68 countries to create campaigns to combat hate speech. And together the companies have participated in hundreds of meetings and trainings to counter violent extremism including events in Beirut, Bosnia, and Brussels and summits at the White House, here at the United Nations, London, and Sydney to empower credible non-governmental voices against violent extremism.
There is no magic computer program that will eliminate online terrorist content, but we are committed to working with everyone in this room as we continue to ramp up our own efforts to stop terrorists’ abuse of our services. This forum is an important step in the right direction. We look forward to working with national and local governments, and civil society, to prevent extremist ideology from spreading in communities and online.
- Kent Walker, Global General Counsel, Google

Working together to combat terrorists online

Last week Google hosted a regional event in Jakarta exploring how ‘counter narratives’ can be used to prevent extremism. Counter narratives can be described as responses to extremist ideas or propaganda and can take many forms. The discussions extended to far right extremism and experiences using counter narratives within this community as well as the definition of extremism.
At the event there was strong representation from Australia and New Zealand with YouTube content creators, civil society groups, academics and policy makers joining the conversation. There was an unanimous agreement that none of us can address this challenge on our own - we need to come together in fora such as the one in Jakarta to share information and ideas; and explore opportunities where we can actively collaborate or support each other’s activities. We look forward to continuing these conversations over the coming months, including within the Global Internet Forum to Counter Terrorism that Kent Walker, our Global General Counsel, describes below.


[Editor’s note: This is a revised and abbreviated version of a speech Kent delivered at the United Nations in New York City, NY, on behalf of the members of the Global Internet Forum to Counter Terrorism.]
The Global Internet Forum to Counter Terrorism is a group of four technology companies—Facebook, Microsoft, Twitter, and YouTube—that are committed to working together and with governments and civil society to address the problem of online terrorist content.
For our companies, terrorism isn’t just a business concern or a technical challenge. These are deeply personal threats. We are citizens of London, Paris, Jakarta, and New York. And in the wake of each terrorist attack we too frantically check in on our families and co-workers to make sure they are safe. We’ve all had to do this far too often.
The products that our companies build lower barriers to innovation and empower billions of people around the world. But we recognize that the internet and other tools have also been abused by terrorists in their efforts to recruit, fundraise, and organize. And we are committed to doing everything in our power to ensure that our platforms aren't used to distribute terrorist material.
The Forum’s efforts are focused on three areas: leveraging technology, conducting research on patterns of radicalization and misuse of online platforms, and sharing best practices to accelerate our joint efforts against dangerous radicalization. Let me say more about each pillar.
First, when it comes to technology, you should know that our companies are putting our best talent and technology against the task of getting terrorist content off our services. There is no silver bullet when it comes to finding and removing this content, but we’re getting much better.
One early success in collaboration has been our “hash sharing” database, which allows a company that discovers terrorist content on one of their sites to create a digital fingerprint and share it with the other companies in the coalition, who can then more easily detect and review similar content for removal.
We have to deal with these problems at tremendous scale. The haystacks are unimaginably large and the needles are both very small and constantly changing. People upload over 400 hours of content to YouTube every minute. Our software engineers have spent years developing technology that can spot certain telltale cues and markers. In recent months we have more than doubled the number of videos we've removed for violent extremism and have located these videos twice as fast. And what’s more, 75 percent of the violent extremism videos we’ve removed in recent months were found using technology before they received a single human flag.
These efforts are working. Between August 2015 and June 2017, Twitter suspended more than 935,000 accounts for the promotion of terrorism. During the first half of 2017, over 95 percent of the accounts it removed were detected using its in-house technology. Facebook is using new advances in artificial intelligence to root out "terrorist clusters" by mapping out the pages, posts, and profiles with terrorist material and then shutting them down.
Despite this recent progress, machines are simply not at the stage where they can replace human judgment. For example, portions of a terrorist video in a news broadcast might be entirely legitimate, but a computer program will have difficulty distinguishing documentary coverage from incitement.
The Forum’s second pillar is focused on conducting and sharing research about how terrorists use the internet to influence their audiences so that we can stay one step ahead.
Today, the members of the Forum are pleased to announce that we are making a multi-million dollar commitment to support research on terrorist abuse of the internet and how governments, tech companies, and civil society can fight back against online radicalization.
The Forum has also set a goal of working with 50 smaller tech companies to help them better tackle terrorist content on their platforms. On Monday, we hosted dozens of companies for a workshop with our partners under the UN Counter Terrorism Executive Directorate. There will be a workshop in Brussels in December and another in Indonesia in the coming months. And we are also working to expand the hash-sharing database to smaller companies.
The Forum’s final pillar is working together to find powerful messages and avenues to reach out to those at greatest risk of radicalization.
Members of the forum are doing a better job of sharing breakthroughs with each other. One success we’ve seen is with the Redirect Method developed at Alphabet’s Jigsaw group. Redirect uses targeted advertising to reach people searching for terrorist content and presents videos that undermine extremist recruiting efforts. During a recent eight-week study more than 300,000 users clicked on our targeted ads and watched more than 500,000 minutes of video. This past April, Microsoft started a similar program on Bing. And Jigsaw and Bing are now exploring a partnership to share best practices and expertise.
At the same time, we’re elevating the voices that are most credible in speaking out against terrorism, hate, and violence. YouTube’s Creators for Change program highlights online stars taking a stand against xenophobia and extremism. And Facebook's P2P program has brought together more than 5,000 students from 68 countries to create campaigns to combat hate speech. And together the companies have participated in hundreds of meetings and trainings to counter violent extremism including events in Beirut, Bosnia, and Brussels and summits at the White House, here at the United Nations, London, and Sydney to empower credible non-governmental voices against violent extremism.
There is no magic computer program that will eliminate online terrorist content, but we are committed to working with everyone in this room as we continue to ramp up our own efforts to stop terrorists’ abuse of our services. This forum is an important step in the right direction. We look forward to working with national and local governments, and civil society, to prevent extremist ideology from spreading in communities and online.
- Kent Walker, Global General Counsel, Google

Google Mobile Ads SDK release 7.24.1 supports iOS 11

We're happy to announce that with this week's release of version 7.24.1, the Google Mobile Ads SDK is officially iOS 11 ready. You can get the latest version via CocoaPods or via manual download.

Check the release notes for a full list of updates. One prominent issue that this SDK release resolves is the banner ad views rendering out of bounds in some situations on iOS 11.

Stay tuned for another SDK update ahead of the iPhone X release. Speaking of which...

iPhone X

At this year's launch event, Apple announced a new iPhone, the iPhone X. With this new device comes a new form factor and some additional design considerations for developers, as the rounded corners, notch, and soft home button on the extended screen can obscure content.

With this in mind, we want to highlight some best practices for Google Mobile Ads publishers to ensure that ad placement conforms to Apple's new design guidelines for the iPhone X and iOS 11.

Banner and native ads should be placed inside the safe area, a concept new to iOS 11. This ensures that ad content is not obscured. Additionally, the safe area respects UI elements such as navigation bars, the status bar, and tab bars on all iOS 11 devices.

When using autolayout, ensure any constraints are relative to safe area layout guides. If you're using manual layout, check that banners and native ads fit within the safeAreaInsets.

For interstitials and rewarded video ads, we're working to ensure all controls and important content are also placed within the safe area. Keep an eye out for another Google Mobile Ads SDK release ahead of the iPhone X release date.

If you have any questions about iOS 11 support in the Google Mobile Ads SDK, please drop us a line at the developer forum.